-1

I have radiogroup :

<RadioGroup android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal|bottom"
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:background="@drawable/overlay_2"
             android:id="@+id/rgSettings">`

             <RadioButton android:layout_width="140dp"
                          android:layout_height="100dp"
                          android:id="@+id/s_mph"
                          android:background="@drawable/settings_speed_mph"
                          android:button="@android:color/transparent"
                          android:layout_gravity="center_vertical|left"/>

             <RadioButton android:layout_width="140dp"
                          android:layout_height="100dp"
                          android:id="@+id/s_kph"
                          android:checked="false"
                          android:background="@drawable/settings_speed_kph"
                          android:button="@android:color/transparent"
                          android:layout_gravity="center"
                          android:gravity="right"/>

</RadioGroup>

Link in screenshot : http://joxi.ru/A5GhUxjKTJBQH7uRaK4

(1) radiogroup (2) - (3) its radio buttons. I need radibutton (2) set in position - left, radiobutton (3) set in right position. What do I need for this?

Add: i need set first button set left position in radiogroup, secondary button set in right position radiogroup. Like This: joxi.ru/FqKhUxjKTJBsH5OWteQ

RaQushka
  • 1
  • 2

1 Answers1

0

Why You are setting the button that You need on the left side as first? Just switch it:

         <RadioGroup android:layout_height="wrap_content"
         android:orientation="horizontal"
         android:layout_width="match_parent"
         android:background="@drawable/overlay_2"
         android:id="@+id/rgSettings">

         <RadioButton android:layout_width="140dp"
                      android:layout_height="100dp"
                      android:id="@+id/s_kph"
                      android:checked="false"
                      android:background="@drawable/settings_speed_kph"
                      android:button="@android:color/transparent"
                      android:layout_gravity="center_vertical|left"
                      android:gravity="right"/>

         <RadioButton android:layout_width="140dp"
                      android:layout_height="100dp"
                      android:id="@+id/s_mph"
                      android:background="@drawable/settings_speed_mph"
                      android:button="@android:color/transparent"
                      android:layout_gravity="center_vertical|right"/>             

         </RadioGroup>

Also, You can play a little bit with the layout_margin attributes to make space between the buttons.

Opiatefuchs
  • 9,800
  • 2
  • 36
  • 49
  • it didnt help me(( in left side i need button (mph) in right (kph) and i need to use only radiobuttons – RaQushka Jun 18 '14 at 14:15
  • oh sorry i wrong. what i need ? i need set first button set left position in radiogroup, secondary button set in right position radiogroup. Like This: http://joxi.ru/FqKhUxjKTJBsH5OWteQ – RaQushka Jun 18 '14 at 14:28
  • have you tested it? I think it would be good to show the complete layout file. If my example doesent work, there could be another layout that is causing this (where Your radiogroup is inside). – Opiatefuchs Jun 20 '14 at 05:59