开发者

Android number input with plus and minus sign

开发者 https://www.devze.com 2022-12-29 18:02 出处:网络
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开发者_如

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

0

精彩评论

暂无评论...
验证码 换一张
取 消