如何改变垂直间距在Android中NumberPicker [英] How to change vertical spacing in Android NumberPicker

查看:1177
本文介绍了如何改变垂直间距在Android中NumberPicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android的NumberPicker部件有很多的当前项目和蓝线上面和下面的空间。有什么办法改变这种间距更加紧凑,所以整个部件并不需要这么多的垂直空间?

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).

推荐答案

您可以使用图书馆定制的DatePicker。在下面的例子中有一个名为NumberPicker.java级,你可以改变的垂直间距和其他的东西。

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

我希望能有帮助。



更新

因为这个用户界面去precated你不能使用这个库。现在,你必须使用材料设计的DatePicker。对此,你可以使用这个其他库。


https://github.com/wdullaer/MaterialDateTimePicker

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

这篇关于如何改变垂直间距在Android中NumberPicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆