2012-02-04 76 views
0

我正在研究android應用程序。在我的頁面中,我保留了listheader,listview和listfooter。我已經禁用了listview的焦點,但是當我試圖禁用頁眉和頁腳時,它並不適用?如何禁用listheader和footer的焦點?

mycode的:

對於列表視圖我已經通過給

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

public boolean isEnabled(int position) { 
return false;  } }; 

listheader.xml 我在XML文件中改變給予可聚焦=假的TextView禁用的焦點

<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> 

listfooter.xml 我在XML文件中給予可聚焦=假的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> 

但即使如此,頁眉和頁腳的焦點並沒有禁止改變。 Pleae幫我關於推動這一 謝謝...

回答