[英]Change color of TimePicker (RadialTimePickerView)?
How do I change the number/picker-color of the TimePicker/RadialTimePickerView? 如何更改TimePicker / RadialTimePickerView的数字/选择器颜色? I can see, that the RadialTimePickerView sets its color internal by using
我可以看到,RadialTimePickerView通过使用设置其内部颜色
final int numbersTextColor = a.getColor(R.styleable.TimePicker_numbersTextColor,
res.getColor(R.color.timepicker_default_text_color_material));
I tried adding a timepicker_default_text_color_material
item to the colors.xml, but this didn't work out. 我尝试将一个
timepicker_default_text_color_material
项添加到colors.xml中,但这没有用。
The black numbers and the blue picker should be white: 黑色数字和蓝色选择器应为白色:
More or less, as Saket commented, I need to append my styles.xml: 或多或少,正如Saket评论的那样,我需要追加我的styles.xml:
<style name="myTimePickerStyle" parent="@android:style/Widget.Material.Light.TimePicker">
<item name="android:numbersTextColor">#ffffff</item>
<item name="android:numbersBackgroundColor">@color/timepicker_header</item>
<item name="android:numbersSelectorColor">#88000000</item>
<item name="android:headerBackground">@color/timepicker_header</item>
</style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:timePickerDialogTheme">@style/myTimePickerDialogStyle</item>
</style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.