What is a good Android analog of iOS's UISegmentedControl
?
Asked
Active
Viewed 2.1k times
42
2 Answers
33
I just wrote a similar implementation here: https://github.com/makeramen/android-segmentedradiobutton
It overrides RadioGroup instead of RadioButton and doesn't override the onDraw method so XML styling still works.

vinc3m1
- 4,075
- 1
- 26
- 23
-
4For any one who don't want to have so many resource image files, you may define your RadioButton background like this [segmented_button_background_first.xml](http://code.google.com/p/android-batsg/source/browse/android-batsg-demo/res/drawable/segmented_button_background_first.xml) file (there is more sample [here](http://code.google.com/p/android-batsg/source/browse/android-batsg-demo/res/drawable)). I also rewrite makeramen's code for more flexible use like [this](http://code.google.com/p/android-batsg/wiki/SegmentedControl) – umbalaconmeogia Feb 12 '12 at 10:26
-
@umbalaconmeogia that looks awesome, feel free to submit as a pull request if you want! – vinc3m1 Feb 13 '12 at 00:29
12
Benjamin Ferrari has a nice implementation here: http://blog.bookworm.at/2010/10/segmented-controls-in-android.html . Essentially he's just overridden the RadioButton.

cagreen
- 1,627
- 1
- 14
- 29
-
1He added a github project that contains a library that you can include in your project that has ICS styled controls that are really slick. Here's the link [https://github.com/bookwormat/segcontrol](https://github.com/bookwormat/segcontrol) – AngeloS Aug 23 '12 at 19:11