我在 groupView 中有几个单选按钮,每个单选按钮都有自己的文本。如果此文本不止一行,则此文本的单选按钮与文本居中对齐,但我想将单选按钮对齐到其文本的顶部。
我的目标 :-
我有:
| text line 1
RB | text line 2
| text line 3
我想:
RB
| text line 1
| text line 2
| text line 3
对于设置文本,我使用 rb.setText( text );
我在 groupView 中有几个单选按钮,每个单选按钮都有自己的文本。如果此文本不止一行,则此文本的单选按钮与文本居中对齐,但我想将单选按钮对齐到其文本的顶部。
我的目标 :-
我有:
| text line 1
RB | text line 2
| text line 3
我想:
RB
| text line 1
| text line 2
| text line 3
对于设置文本,我使用 rb.setText( text );
你可以这样试试:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/test_text" />
</LinearLayout>