如何改变数字选择器风格的Andr​​oid?风格、数字、选择器、oid

由网友(月亮有点困)分享简介:我想使用NumberPicker组件,部件,而是在默认的Holo主题,我需要更换蓝色与橙色,因为这是我的风格的默认颜色。如何可以代替蓝色颜色和数字的颜色,并保持所有的组件的功能?谢谢I want to use the NumberPicker component-widget but Instead in the...

我想使用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.

阅读全文

相关推荐

最新文章