我有一個自定義ListView
,其中每個row.xml
看起來是這樣的:爲什麼當ListView被觸摸時,CheckBox的背景顏色會發生變化?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/star_listed"
style="?android:attr/starStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:contentDescription="@string/question_img_cd"
android:focusable="false"/>
<TextView
android:id="@+id/listTitles"
style="@style/ListTitles" />
當我任何位置上按了ListView
,的CheckBox
變爲黑色背景,一切工作只是罰款(而不是保持白色)。它發生在我的TextView
之前,直到我將它的背景顏色設置爲白色。
如果我改變了'CheckBox'背景爲白色,甚至tranparent,它就會消失。
有什麼建議嗎?
http://samir-mangroliya.blogspot.in/p/android-customized-listview.html –
我的自定義'ListView'工作正常。我的鏈接中沒有看到與我的問題相關的任何內容。 – eskalera