How to change vertical spacing in Android NumberPicker

最后都变了- 提交于 2019-12-11 09:39:38

问题


The Android NumberPicker widget has a lot of space between the current item and the blue lines above and below it. Is there any way to change this spacing to be more compact, so the whole widget does not take so much vertical space?

(I do not want to scale the entire widget, just reduce the spacing).


回答1:


You can to customize the DatePicker using a Library. In example below has a class named "NumberPicker.java", that you can change the vertical spacing and other things.

https://github.com/rodrigobusata/android-pickers

I hope to have helped.


UPDATE

You mustn't use this library because this UI is deprecated. Now you must use Material Design DatePicker. To this, you can use this other lib.
https://github.com/wdullaer/MaterialDateTimePicker



来源:https://stackoverflow.com/questions/28056744/how-to-change-vertical-spacing-in-android-numberpicker

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