本文介绍了如何改变数字选择器风格的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用NumberPicker组件,部件,而是在默认的Holo主题,我需要更换蓝色与橙色,因为这是我的风格的默认颜色。如何可以代替蓝色颜色和数字的颜色,并保持所有的组件的功能?谢谢

I want to use the NumberPicker component-widget but Instead in the default Holo theme I need to replace the blue color with orange since that is the default color in my styling.How can I replace the blue color and the color of the numbers,and keep all of the functionality of the component?thanks

推荐答案

请库/ RES /可绘制副本 - * / numberpicker_selection_divider.9.png和名称,然后,例如,custom_np_sd.9.png

Make copy of library/res/drawable-*/numberpicker_selection_divider.9.png and name then, for example, custom_np_sd.9.png.

通过活动的主题覆盖默认NumberPicker风格:

Override default NumberPicker style via activity theme:

<style name="AppTheme" parent="@style/Holo.Theme">
  <item name="numberPickerStyle">@style/CustomNPStyle</item>
</style>
<style name="CustomNPStyle" parent="@style/Holo.NumberPicker">
  <item name="selectionDivider">@drawable/custom_np_sd</item>
</style>

和应用@风格/ AppTheme为活动主题。

And apply @style/AppTheme as activity theme.

这篇关于如何改变数字选择器风格的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 02:58