2016-09-20 115 views
0

我在Android Studio的RadioButton的同一行上對齊文本時遇到問題。RadioButton文本對齊?

這是我有...

Application Picture

任何想法?

+1

我不明白你問 – njzk2

+0

我想在一個單選按鈕文本在同一行按鈕本身,當我在應用程序中。現在,由於文本非常長,文本從單選按鈕上方開始一行,如上所示。這有意義嗎? – Mir

+0

請發佈示例XML佈局。 –

回答

0

好的嘗試了這一點,

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingLeft="16dp" 
    android:paddingRight="16dp" 
    android:orientation="horizontal" > 

    <RadioButton 
    android:id="@+id/radio_pirates" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="male" 
    android:onClick="onRadioButtonClicked"/>> 

    <TextView 
     android:layout_width="100dp" 
     android:text="besides" 
     android:layout_height="wrap_content" 
     android:layout_gravity="right" 
     android:text="@string/send" /> 
</LinearLayout> 
+0

是的,但我如何讓該文本出現在顯示按鈕的同一行?有些文本非常長,它們在按鈕所在的位置上方開始一行(請參閱問題)。我想調整文本以與RadioButton相同的行開始。 – Mir