Change color of TimePicker (RadialTimePickerView)?

微笑、不失礼 提交于 2019-12-22 10:46:40

问题


How do I change the number/picker-color of the TimePicker/RadialTimePickerView? I can see, that the RadialTimePickerView sets its color internal by using

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.

The black numbers and the blue picker should be white:


回答1:


More or less, as Saket commented, I need to append my 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>


来源:https://stackoverflow.com/questions/31360520/change-color-of-timepicker-radialtimepickerview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!