iOS SegmentedControl equivalent in Android [closed]
Asked Answered
I

2

42

What is a good Android analog of iOS's UISegmentedControl?

Input answered 17/10, 2010 at 11:24 Comment(0)
R
32

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.

Rhizotomy answered 30/4, 2011 at 15:54 Comment(2)
For 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 file (there is more sample here). I also rewrite makeramen's code for more flexible use like thisJornada
@Jornada that looks awesome, feel free to submit as a pull request if you want!Rhizotomy
D
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.

Dentifrice answered 30/11, 2010 at 4:3 Comment(1)
He 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/segcontrolInflexion

© 2022 - 2024 — McMap. All rights reserved.