如何更改Android中的数字选择器样式?

2024-04-01

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? the default number picker in Holo thanks


不幸的是,你无法设置它的样式。的样式和样式属性NumberPicker不存在于公共 API 中,因此您无法设置它们并更改默认外观。您只能在浅色和深色主题之间进行选择。

作为解决方案,我建议使用android-numberpicker https://github.com/SimonVT/android-numberpicker图书馆代替。该库基本上是从 Android 源代码中提取的 NumberPicker 的端口。但比这更好的是,它还可以向后移植NumberPicker到 Android 2.x。该库可以轻松设计。

调整分隔线的样式NPWidget.Holo.NumberPicker风格及其selectionDivider and selectionDividerHeight属性。
调整文本样式NPWidget.Holo.EditText.NumberPickerInputText style.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何更改Android中的数字选择器样式? 的相关文章

随机推荐