xuexiangjys / XUI

💍A simple and elegant Android native UI framework, free your hands! (一个简洁而优雅的Android原生UI框架,解放你的双手!)

Home Page:https://xuexiangjys.github.io/XUI/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XUICommonListItemView 无法修改背景色(实现暗黑模式)

Dylan-H opened this issue · comments

1、尝试修改style方式
通过在自己的style 中定义 XUICommonListItemViewStyle 向本地的 style

<item name="XUICommonListItemViewStyle">@style/MyCommonListItemView</item>

在自定义sytle 中重新指定新的背景颜色 或者drawable ,背景始终是白色, PS:下面的字体颜色是生效的

<style name="MyCommonListItemView" parent="XUICommonListItemView">
        <item name="android:background">@color/red_end</item>
        <item name="xui_commonList_titleColor">@color/green_end</item>
 </style>

2 .尝试在demo程序中直接修改

xui_lib/src/main/res/drawable/xui_list_item_bg_with_border_none_selector.xml
xui_lib/src/main/res/drawable-v17/xui_list_item_bg_with_border_none_selector.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/xui_config_color_red" android:state_pressed="true"/>
    <item android:drawable="@color/xui_config_color_black"/>
</selector>

颜色依然是白色背景

commented

已解决:
ec89b7d