There's a NumberPicker widget in API 11, but I'm building for a minimum API of 7. How would I go about implementing one? Is there a custom widget that I can use, or is there a way to get at the components that make up DatePicker / TimePicker?
-
1http://www.quietlycoding.com/?p=32 check this – Andy Feb 09 '12 at 03:48
-
http://stackoverflow.com/questions/12282337/alternative-to-numberpicker-for-api-8/12282540#12282540 – Yalla T. Apr 17 '15 at 13:23
4 Answers
I find this one very good and flexible given that there were few ready made options available at that api level at the beginning of 2012 when this question was asked.
http://code.google.com/p/android-wheel/
EDIT: So what if IOS has a similar looking control. That does not make this answer bad. Android is about freedom of choice. Besides, the look of this control is dependent on styles. Take away the shadow, add blue highlights and it looks identical to the Android 4 time picker which is what the OP was asking for.
I am pointing to a possible solution to a persons problem. I am NOT advocating that Android apps should look like IOS apps and I personally hate Android apps that are badly ported so they are a clone of their IOS versions. Some people really are fanboys.

- 35,581
- 10
- 79
- 92
-
3What are you talking about? There was no mention of IOS and the link I gave is for an Android library. – Kuffs Jun 25 '13 at 05:54
-
-
3irrelevant. its an android library that suited the OP's needs at the time as there was no standard number picker widget. The look of the control I linked to depends on how you set it up. It doesnt have to look like the example. I have never used an ios device so i cannot comment if it looks similar. – Kuffs Jun 25 '13 at 13:06
-
3Agreed, @Kuffs answer was exactly what I was needing at the time. And just because it's laid out similarly to iOS does not automatically make it bad. It did its job well and that's the important factor. – InsanityOnABun Aug 01 '13 at 02:34
copy the NumberPicker's code in API11 to your project.
xuyao's post doesn't work. The NumberPicker has API11-dependencies (android.animator.*) which cannot be easily replaced. You have to take one of the given libraries.

- 2,464
- 2
- 16
- 17