ListPreference text color

帅比萌擦擦* 提交于 2019-12-02 11:43:44

You did everything right, except one thing: do not use the android prefix when overriding textColorAlertDialogListItem because this is not the framework version of AlertDialog.

This statement is generally true for almost all attributes that belong to the support widgets / views. The reason is pretty straightforward: not all attributes are available on the older platforms. Such example is android:colorControlActivated which was introduced in API 21. The AppCompat lib declares its own colorControlActivated so it's available on older API levels, too. In this case the developer should not use the android prefix when defining the style in the theme as that would point to the platform version of the attribute instead of the AppCompat one.

TL;DR: Do not use the android prefix for support widgets unless you have to (i.e. you get compilation error).


P.S.: I have created a fix / extension to the support preferences-v7 lib's annoying things that you might want to check out.

Also for radio buttons color add <item name="colorAccent">#000000</item> to your style. Be careful, it's not android:colorAccent but colorAccent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!