【发布时间】:2019-07-07 01:44:39
【问题描述】:
如何在滚动时在数字选择器中显示更多项目/数字,因为它只显示 3 个数字。这是我的代码
NumberPicker starttime = (NumberPicker) findViewById(R.id.timeListview);
starttime.setMaxValue(47);
String[] time = {"12:00 AM", "12:30 AM", "01:00 AM", "01:30 AM", "02:00 AM", "02:30 AM", "03:00 AM","11:00 PM", "11:30 PM"};
starttime.setDisplayedValues(time);
starttime.setWrapSelectorWheel(true);
【问题讨论】:
-
我认为这对于 Native
NumberPicker小部件是不可能的。 -
可以试试,numberPicker.setWheelItemCount(5)
-
@ADM 你知道在不使用 NumberPicker 的情况下如何在滚动时显示更多元素并使中间元素聚焦的其他方法吗?
-
@Hasanuzzaman Rana 它不工作
-
如果可以的话,你可以使用第三方库 Like This one 我在第一次搜索时找到的。
标签: android numberpicker