1

I have some radio buttons (in both vertical and horizontal orientation) and I want to text jusify the android:text="1", android:text="2", android:text="3", and android:text="4" of the respective radio buttons to the left (next to the radio button). I have not been able to find a solution to setting up the LinearLayout to accomplish this. Any help would be appreciated. My xml file is:

<LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   <RadioGroup
      android:id="@+id/Group01"
      android:layout_weight="1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
      <RadioButton
         android:id="@+id/rb01"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="1" />
      <RadioButton
         android:id="@+id/rb02"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="2" />
   </RadioGroup>
   <RadioGroup
      android:id="@+id/Group02"
      android:layout_weight="1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
      <RadioButton
         android:id="@+id/rb03"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="3" />
      <RadioButton
         android:id="@+id/rb04"
         android:layout_width="50dp"
         android:layout_height="15pt"
         android:checked="true"
         android:text="4" />
   </RadioGroup>
</LinearLayout>
Jonas
  • 121,568
  • 97
  • 310
  • 388
Terry
  • 141
  • 1
  • 2
  • 7
  • You Mean you want to display text in the left and the radiobutton on right. Like this -> [Text (.)] ? – Kartik Domadiya Apr 01 '11 at 04:56
  • Extend Radiobutton class and implement your own layout and funtions. That should do the trick. – Kartik Domadiya Apr 01 '11 at 05:23
  • Kartik, Thanks for your response. I don't want to switch from the right side of the button to the left side. I want to pull the text field content (ie, the numbers "1", "2", etc in close to the button, left justified in the text field) so that I can line up a number of radio buttons (horizontally). – Terry Apr 02 '11 at 02:30

0 Answers0