Android 将ListView中未选定项的颜色更改为默认颜色

Android 将ListView中未选定项的颜色更改为默认颜色,android,android-layout,android-listview,android-ui,Android,Android Layout,Android Listview,Android Ui,我想将ListView中TextView的颜色更改为默认主题,但现在它有不同的“未选择”颜色(在我的例子中是灰色而不是白色)。我尝试了以下代码,以选择主题默认颜色,但它给了我一个错误二进制XML文件… <TextView android:id="@+id/botText" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17s

我想将
ListView
TextView
的颜色更改为默认主题,但现在它有不同的“未选择”颜色(在我的例子中是灰色而不是白色)。我尝试了以下代码,以选择主题默认颜色,但它给了我一个错误
二进制XML文件…

<TextView
    android:id="@+id/botText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="17sp"
    android:paddingTop="2dp"
    android:paddingBottom="5dp"
    android:textColor="?android:attr/textColor"
/>


android:attr/textColor替换为@android:attr/textColor如果您想使用自己选择的颜色,请使用Selector@UsmanKurd我仍然会犯同样的错误<代码>错误膨胀类首先调试带有断点的代码,您认为这可能会导致崩溃并从中返回跟踪,但仍然找不到任何sol,然后粘贴代码并记录cat错误here@UsmanKurd
原因:android.content.res.Resources$NotFoundException:资源不是ColorStateList(颜色或路径)
将您的代码放在此处,并查看此代码