Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.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 如何禁用listheader和footer的焦点?_Android - Fatal编程技术网

Android 如何禁用listheader和footer的焦点?

Android 如何禁用listheader和footer的焦点?,android,Android,我正在开发android应用程序。在我的页面中,我保留了listheader、listview和listfooter。我已经禁用了listview的焦点,但是当我试图禁用页眉和页脚时,它没有应用 霉菌代码: 对于listview,我通过给出 lvAdapter adapter = new lvAdapter(this,list){ public boolean areAllItemsEnabled() { return false; } public boolean isEnabled

我正在开发android应用程序。在我的页面中,我保留了listheader、listview和listfooter。我已经禁用了listview的焦点,但是当我试图禁用页眉和页脚时,它没有应用

霉菌代码:

对于listview,我通过给出

lvAdapter adapter = new lvAdapter(this,list){
public boolean areAllItemsEnabled() {
    return false; }

public boolean isEnabled(int position) {
return false;      }    };
listheader.xml 我在xml文件中更改了文本视图中的focusable=false

 <TextView
            android:id="@+id/text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textColor="#000000"
            android:focusable="false"
            android:clickable="false"
            android:enabled="false"
            android:textSize="12dip" >
    </TextView>
<TextView
        android:id="@+id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textColor="#000000"
        android:focusable="false"
        android:clickable="false"
        android:enabled="false"
        android:textSize="12dip" >
</TextView>

listfooter.xml 我在xml文件中更改了文本视图中的focusable=false

 <TextView
            android:id="@+id/text1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textColor="#000000"
            android:focusable="false"
            android:clickable="false"
            android:enabled="false"
            android:textSize="12dip" >
    </TextView>
<TextView
        android:id="@+id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textColor="#000000"
        android:focusable="false"
        android:clickable="false"
        android:enabled="false"
        android:textSize="12dip" >
</TextView>

但即便如此,页眉和页脚的焦点也没有被禁用。请帮我解决这个问题
提前感谢…

在添加标题时,您可以使用

作为

添加页脚的方法也一样

作为