How to design radio buttons vertically connected with vertical line and each radio button with different color

682 views Asked by At

I have to design a layout that contains radio buttons are aligned in vertical pattern and attached with a vertical line. Each radio button is checked, with different color. Below picture will illustrate the design.

https://i.stack.imgur.com/lMxvV.jpg

Anyone can guide me how can I achieve this design.

Thanks and Regards Hasnain Ahmad

1

There are 1 answers

10
bunbun On

What you can do is a ListView: developer.android.com/guide/topics/ui/layout/listview.html A fairly recent tutorial is listed here: http://www.vogella.com/tutorials/AndroidListView/article.html

  1. On each list item, add a radio button on the left. Android: Radio button in custom list view
  2. Add a custom background on each list item, which includes a line on the left side as you have specified. The line should align with your radio button. ListView item background via custom selector
  3. Finally, remove the line separators between each list item by making them White or transparent. How to change color of Android ListView separator line?

This will give the list the look you wanted.