2
我已將lsitview選擇器顏色更改爲透明。即使在我點擊列表項時,文本的顏色也會變成深灰色......無論如何要處理這個問題。我不想要的顏色,以在項目點擊來改變..android:刪除列表視圖選擇器
我已將lsitview選擇器顏色更改爲透明。即使在我點擊列表項時,文本的顏色也會變成深灰色......無論如何要處理這個問題。我不想要的顏色,以在項目點擊來改變..android:刪除列表視圖選擇器
第一這個問題的解決方案實現,我們可以創建自定義列表視圖...
假設你的ListView XML文件像...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:layout_height="wrap_content"
android:id="@android:id/list"
android:layout_width="match_parent"></ListView>
</LinearLayout>
和自定義視圖xml文件...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/black"
>
<TextView
android:text="TextView"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="30dip">
</TextView>
</LinearLayout>
和運行應用程序......比你點擊的項目沒有顏色顯示...
獲取有關此問題的完整代碼click here。
這樣做意味着用戶將無法使用指點設備來導航您的應用程序。請重新考慮你的計劃。 – CommonsWare
你是否將文本的文本顏色設置爲黑色或事先在列表視圖項中顯示? –