如何更改 Android DatePicker Dialog 的“Dividers"颜色 [英] How to change Android DatePicker Dialog's "Dividers" Colors
本文介绍了如何更改 Android DatePicker Dialog 的“Dividers"颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个自定义对话框,基本上我正在使用 DatePickerDialog.THEME_HOLO_DARK
但我想更改分隔符"颜色和文本颜色.
I'm trying to create a custom dialog, basically I'm using DatePickerDialog.THEME_HOLO_DARK
but I want to change the "divider" color and the text color.
我想将蓝色线条和文本颜色更改为红色.
I want to change the blue lines and the text color to red.
提前致谢!
使用此代码:
<style name="testo" parent="@android:style/Widget.DeviceDefault.DatePicker">
<item name="android:divider">@drawable/dialog_divider</item>
</style>
这是我得到的:
分隔线的drawable基本上是一条红线..
The drawable for the divider is basically a red line..
推荐答案
将此项目添加到您的主题
add this item to your main theme
<item name="numberPickerStyle">@style/MyApp.NumberPicker</item>
在此样式中设置自定义分隔线颜色
set custom divider color in this style
<style name="MyApp.NumberPicker" parent="Widget.Holo.NumberPicker">
<item name="selectionDivider">@color/white</item>
</style>
仅在 HoloEverywhere 上测试
EDIT : tested only on HoloEverywhere
这篇关于如何更改 Android DatePicker Dialog 的“Dividers"颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文