我在我的应用程序中有listpreference,我想自定义它,我可以设置主题为prefs活动如下:
<activity android:name=".Prefs" android:label="@string/app_name" android:theme="@style/PreferencesTheme">
偏好风格:
<?xml version="1.0" encoding="utf-8" ?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="PreferencesTheme" parent="android:Theme"> <item name="android:background">#FFDAB9</item> <item name="android:textColor">@color/red_color</item> <item name="android:textSize">20sp</item> </style> </resources>
上面的样式改变了ListPreference背景和ListPreference标题的文本大小和文本颜色,但它不会改变ListPreference的总结文本颜色或大小的任何方式来做到这一点,
我试过这个代码,但它不工作:
<item name="android:textColorSecondary">@color/red_color</item>
任何帮助将不胜感激,谢谢
解决方法
也许现在为时已晚,但是尝试删除你的颜色线:
<item name="android:textColor">@color/red_color</item>
并添加这些是主要,次要和三次颜色
<item name="android:textColorPrimary">@color/red_color</item> <item name="android:textColorSecondary">@color/red_color</item> <item name="android:textColorTertiary">@color/red_color</item>
你可以选择你想要的颜色,老实说,我从来没有看到任何偏好页面的第三色,但主要是主要和大文本,次要的是小文本出现在主要的下面.
希望有帮助
原文地址:https://www.jb51.cc/android/311727.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。