-1

i have created radio buttons added to radio group programmatically, the radio group in xml is as below

<RadioGroup
android:layout_width="match_parent"
android:id="@+id/rgFeedbacks"
android:orientation="vertical"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding"
android:paddingStart="@dimen/appbar_padding"
android:divider="@color/radiogroup_divider"

and the radio buttons are added like below

 for(int i=0; i<array.size(); i++){
        rb[i]  = new RadioButton(this);
        rb[i].setId(i);
        rb[i].setText(Array.get(i));
   }
       

the problem is the divider is not showing between the radio buttons, how to solve it

Malo
  • 1,232
  • 2
  • 17
  • 28

1 Answers1

1

You should add showDividers like this:

android:divider="@color/radiogroup_divider"
android:showDividers="middle"
Ali Moghadam
  • 1,026
  • 1
  • 9
  • 8