这个解决方案并不能满足我们的期望,因为旋转器下拉框太高了.有没有更好的办法?我在看Numberpicker – 但这似乎只适用于Integer值.
有任何想法吗?
谢谢!
解决方法 NumberPicker不只是用于整数..甚至你可以使用floats String等.看this并了解它.
用于教程:
> 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并分配它.
总结以上是内存溢出为你收集整理的浮点数的android numberpicker全部内容,希望文章能够帮你解决浮点数的android numberpicker所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)