タイトルによれば、RadioGroup
の下にあるToggleButton
の直下のテキストを整列させる必要があります。下のテキストビューToggleButton RadioGroup内
私は、各サークルの下のステータステキストをしたいです。 RelativeLayout
などの組み合わせで試しましたが、うまくいきませんでした。あなたは以下のようなレイアウトを使用することを検討して代わりの姿勢水平にRADIOGROUP内のTextViewウィジェットを追加することができます
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingTop="10dp">
<RadioGroup
android:id="@+id/toggleGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ToggleButton
android:id="@+id/toggleOnlineStatus"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:background="@drawable/style_toggle_button"
android:checked="true"
android:textOff=""
android:textOn="" />
<TextView
android:id="@+id/tvOnline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/toggleOnlineStatus"
android:layout_centerHorizontal="true"
android:text="Away" />
<ToggleButton
android:id="@+id/toggleAwayStatus"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:background="@drawable/style_toggle_button"
android:textOff=""
android:textOn="" />
<TextView
android:id="@+id/tvAway"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Away" />
<ToggleButton
android:id="@+id/toggleDNDStatus"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:background="@drawable/style_toggle_button"
android:textOff=""
android:textOn="" />
<TextView
android:id="@+id/tvDND"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="DND" />
<ToggleButton
android:id="@+id/toggleXAStatus"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:background="@drawable/style_toggle_button"
android:textOff=""
android:textOn="" />
<TextView
android:id="@+id/tvXA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="XA" />
</RadioGroup>
</LinearLayout>
は、最初の内部二 'LinearLayout'ですか?もしそうなら、これは右側に 'TextView'を表示します。 –
あなたの親線形レイアウトを確認し、私は – Inducesmile
素晴らしいを使用して水平の代わりに垂直方向に向きを変更しました。それは動作します。しかし、テキストをボタンに合わせるためにいくつかのパディングをしなければならなかった。ありがとうございました! –