NumberPicker
不仅仅是整数..甚至你可以使用Floats
String
etc.
see this http://developer.android.com/reference/android/widget/NumberPicker.html并阅读相关内容。
对于教程:
- http://gafurbabu.wordpress.com/2012/03/29/android-number-picker-dialog/ http://gafurbabu.wordpress.com/2012/03/29/android-number-picker-dialog/
我曾经用过NumberPicker
很久以前就这样了,在这里发帖可能会有一些用处:
NumberPicker np;
String nums[]= {"Select Fraction","1/64","1/32","3/64","1/16","5/64","3/32","7/64","1/8","9/64","5/32","11/64","3/16","13/64","7/32","15/64","1/4","17/64","9/32","19/64","5/16","21/64","11/32","23/64","3/8","25/64","13/32","27/64","7/16","29/64"};
np = (NumberPicker) findViewById(R.id.np);
np.setMaxValue(nums.length-1);
np.setMinValue(0);
np.setWrapSelectorWheel(false);
np.setDisplayedValues(nums);
np.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
你(们)能做到ArrayList
任何数据类型并分配它。