【发布时间】:2013-10-23 02:29:09
【问题描述】:
我想将我的 ListPreference 的标题和线条颜色从蓝色更改为粉红色,以匹配我的操作栏的线条。
有什么想法吗?提前致谢!
我一直在通过 Android 的 themes.xml 和 styles.xml 寻找类似 @987654324@ 的东西,但还没有弄清楚。
【问题讨论】:
标签: android styles android-preferences
我想将我的 ListPreference 的标题和线条颜色从蓝色更改为粉红色,以匹配我的操作栏的线条。
有什么想法吗?提前致谢!
我一直在通过 Android 的 themes.xml 和 styles.xml 寻找类似 @987654324@ 的东西,但还没有弄清楚。
【问题讨论】:
标签: android styles android-preferences
今天遇到了同样的问题。 旧线程,但我找到了this:,它运行良好。
只需修改你的styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<!-- Add this -->
<item name="android:dialogTheme">@style/DialogStyle</item>
<item name="android:alertDialogTheme">@style/DialogStyle</item>
</style>
<!-- Customize your color here -->
<style name="DialogStyle" parent="android:Theme.Material.Dialog">
<item name="android:colorAccent">@color/colorAccent</item>
</style>
【讨论】:
styles.xml 混在一起时,我总是完全迷失方向,经过数小时的挖掘答案,这是引导我走上正确道路的答案。
在this answer 之后创建了一个自定义ListPreference 小部件。
我希望能够简单地更改样式而不必实现自定义小部件,但我还没有想通。
【讨论】: