更改TimePicker(RadialTimePickerView)的颜色? [英] Change color of TimePicker (RadialTimePickerView)?

查看:646
本文介绍了更改TimePicker(RadialTimePickerView)的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改TimePicker / RadialTimePickerView的数字/选择器颜色?我可以看到,RadialTimePickerView使用

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));

我尝试将 timepicker_default_text_color_material 项添加到colors.xml,但这没有用。

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:

推荐答案

或多或少,正如Saket评论的那样,我需要追加我的styles.xml:

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>

这篇关于更改TimePicker(RadialTimePickerView)的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆