2016-05-26 10 views
3

Ich muss Text unter RadioButton von diesem RadioButton Text, nicht von RadioButton Symbol ausrichten. Kann ich es ohne harte Marge bekommen?Ausrichtung Text unterhalb RadioButton

Beispiel: enter image description here

Mein Code unten:

    <LinearLayout 
         android:id="@+id/llcontainer" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:layout_marginTop="@dimen/half_keyline" 
         android:orientation="horizontal"> 

         <RadioButton 
          android:layout_width="0dp" 
          android:layout_height="wrap_content" 
          android:layout_weight="1" 
          android:text="text1"/> 

        </LinearLayout> 
+0

zeigen Sie uns Ihre Layout-Datei, so können wir Ihnen in der bestmöglichen Art und Weise helfen, die Eltern Radio buttonand Text hält, etc ... –

+0

ist es nur mit Linearlayout RadioButton- innen – ksarkes

+1

könnten Sie eine benutzerdefinierte verwenden Schaltfläche (mit einer bekannten Größe) für das RadioButton-Häkchen. Verwenden Sie dann die gleiche Breite für den linken Rand der Textansicht. –

Antwort

-1

Try this:

    <RadioButton 
         android:id="@+id/rbtn" 
         android:layout_width="0dp" 
         android:layout_height="wrap_content" 
         android:layout_weight="1" 
         android:text="text1"/> 

        < TextView 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:id="@+id/text1" 
         android:layout_below="@+id/rbtn" <!-- this here --> 
         android:text="@string/hello_world"/> 
       </RelativeLayout> 
-1

Versuchen Sie, diese

<LinearLayout 
    android:id="@+id/llcontainer" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

    <RadioButton 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="text1"/> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="text2" 
     android:layout_marginLeft="30dp"/> 

</LinearLayout> 
-1

versuchen diese

<RadioButton 
    android:id="@+id/Icon1" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:background="@android:color/transparent" 
    android:button="@android:color/transparent" 
    android:drawablePadding="-20dp" 
    android:drawableTop="@drawable/your_Image_Here" 
    android:gravity="center" 
    android:text="text1" />