Android Hide TimePicker numbers?

大兔子大兔子 提交于 2019-12-24 14:16:40

问题


Is there a way to hide these numbers? Im guessing there must be an attribute which once set to 'false' should to it.

Also, i've tried to use custom drawables for the the up/down arrow, but those seem to overlay on top of the numbers (ie,the numbers are still visible)

Note: I could make custom pickers where I use a textView in between two imageViews, but the default timePicker allows one to swipe up and scroll through numbers (so would prefer using the default)

Edit: Apparently the NumberPicker has different children in different versions of android(the emulator shows the up/bottom arrows, while on my Samsung Tab they return a nullpointerexception). Wow!


回答1:


Instead of using a time picker you could try and use a number picker instead, this means that you can specifically set what you want to be in the picker.




回答2:


Is there a way to hide these numbers?

No, sorry.

Im guessing there must be an attribute which once set to 'false' should to it.

Only if you fork TimePicker and add such an attribute yourself.



来源:https://stackoverflow.com/questions/22988150/android-hide-timepicker-numbers

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