What is a good Android analog of iOS's UISegmentedControl
?
iOS SegmentedControl equivalent in Android [closed]
Asked Answered
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.
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 this –
Jornada
@Jornada that looks awesome, feel free to submit as a pull request if you want! –
Rhizotomy
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.
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/segcontrol –
Inflexion
© 2022 - 2024 — McMap. All rights reserved.