How to change vertical spacing in Android NumberPicker
Asked Answered
S

1

1

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

Smashup answered 20/1, 2015 at 22:59 Comment(0)
F
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

Fie answered 20/1, 2015 at 23:15 Comment(3)
Link is not working. How do you change the vertical spacing?Budding
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.github.com/wdullaer/MaterialDateTimePickerFie
@HampelElőd - I am in same situation. They always provide IOS design and expect android to behave like ios.Chalcanthite

© 2022 - 2024 — McMap. All rights reserved.