2011-03-03 66 views
1

當我點擊listview時,它不顯示焦點顏色。ListView項目在點擊時不會顯示焦點顏色

<ListView 
     android:id="@+id/android:list" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:divider="@color/grey" 
     android:dividerHeight="1px" 
     android:drawSelectorOnTop="true" 
     android:cacheColorHint="@android:color/transparent"/> 

回答

1

如果你使用透明色那麼它怎麼會看.. 只是改變你的顏色...

+0

如果我設置另一種顏色,那麼我也無法看到焦點顏色。 – 2011-03-03 12:23:43

+0

刪除此屬性..android:cacheColorHint =「@ android:color/transparent」 – 2011-03-03 12:27:26

+0

是的。我刪除它,但它不能幫助顯示焦點顏色。 – 2011-03-03 12:29:13

2

ListView■不要顯示焦點(或選擇),而在觸摸模式。您只有在使用硬件鍵盤或控件導航UI時纔會看到此內容。

有關更多詳細信息,請參閱Google博客文章Touch Mode

因此,如果您只使用觸摸模式,您將永遠不會看到焦點或ListView s上的選擇。