Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为什么我的标题可以在ListFragment上单击_Android - Fatal编程技术网

Android 为什么我的标题可以在ListFragment上单击

Android 为什么我的标题可以在ListFragment上单击,android,Android,我有一个ListFragment,在ListFragment.onViewCreated中,我有以下代码: super.onViewCreated(view, savedInstanceState); View header = getActivity().getLayoutInflater().inflate(R.layout.rowheader, null); this.getListView().addHeaderView(header); 我的布局只有一个线性布局(水平),里面有四个文

我有一个ListFragment,在ListFragment.onViewCreated中,我有以下代码:

super.onViewCreated(view, savedInstanceState);
View header = getActivity().getLayoutInflater().inflate(R.layout.rowheader, null);
this.getListView().addHeaderView(header);
我的布局只有一个线性布局(水平),里面有四个文本视图

现在我不明白的是,标题接收点击事件,当点击时,它还显示标题上的蓝色叠加/颜色/内容。这怎么可能,我能不能以某种方式禁用它

多谢各位

瑟伦

标题视图是什么类型的对象

您可能希望查看视图是否具有
setEnabled()
方法、
setClickable()
setSelectable()
。您可以在将标题视图添加到列表视图之前设置此选项

this.getListView().addHeaderView(header, null, false) 
而不是

this.getListView().addHeaderView(header);

如果有效,请不要忘记标记为已接受