问题
The minimum sdk of my app is 7, but I can use DialogFragment which is from sdk version 11, because it is in the support library which is in my lib directory.
I'd like to make something like this example: http://developer.android.com/guide/topics/ui/controls/pickers.html
But I want to use the NumberPicker widget, which is from sdk version 11 too, but my app does not allow this. Do I have to add other support library?
How can I use this component?
Thank you.
回答1:
Do I have to add other support library?
The Android Support library does not offer NumberPicker
. Other people have created their own backports of NumberPicker
that you could use, such as SimonVT's one.
回答2:
To those that want to support a number picker all the way back to Froyo at least, without using a third-party library or writing your own implementation, you can use the source code of the NumberPicker written by Romain Guy used in the AOSP Messaging app on Github. View my answer on this post for a link to the code.
来源:https://stackoverflow.com/questions/13494132/how-to-use-numberpicker-in-android-app-with-api-7