I am developing in Android and I would like an input field for numbers, where the user can select the correct number using the plus sign at the top and the minus sign at the bottom of the inpu开发者_如何学编程t field. I know this works for DatePicker
. Is there some property or something similar to make this available for any integer number input field?
Thanks
NumberPicker is now available in Android SDK. (Added in API level 11)
http://developer.android.com/reference/android/widget/NumberPicker.html
I've just released some code that does just what you want. Check out my custom control, NumberPicker, which can be seen here: http://www.technologichron.net/?p=42
As far as I know, there's no built-in widget for doing this. You'd have to write your own. Here's the source for DatePicker - you can use it for inspiration.
The open source number picker project found here: https://github.com/mrn/numberpicker
does precisely what is requested
Maybe useful:
http://groups.google.com/group/android-developers/browse_thread/thread/65da9820998fddc9
精彩评论