android - Set the number of visible items in a NumberPicker -
i have simple numberpicker this:

and wondering how can make show more elements above , below selected element.
for example, in picture can see "9" above selected element "10", , "11" right below it.
i change number of visible rows shows more elements "7, 8, 9", selected element "10", "11, 12, 13".
this code:
<numberpicker android:id="@+id/picker" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="15dp" android:gravity="center" android:textcolor="@android:color/white" android:textsize="16sp" /> and i've tried change setting android:layout_height match_parent , big number (e.g. 500dp) doesn't seen work...
finally able find workaround problem. need extend numberpicker class , need change
private static final int selector_wheel_item_count = 3; from 3 more wish, display according available space.
you can find library , sample here.
Comments
Post a Comment