如何更改TimePicker / RadialTimePickerView的数字/选择器颜色?我可以看到,RadialTimePickerView使用
设置其内部颜色final int numbersTextColor = a.getColor(R.styleable.TimePicker_numbersTextColor,
res.getColor(R.color.timepicker_default_text_color_material));
我尝试在colors.xml中添加timepicker_default_text_color_material
项,但这并没有成功。
黑色数字和蓝色选择器应为白色:
答案 0 :(得分:4)
或多或少,正如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>