私はこのようなアラインメントを実行しようとしてい左のTextViewと右のRadioButtonのLinearLayout?
、午後グッド:あなたが見ることができるように
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="0sp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dark background"
android:textAppearance="@style/TextAppearance.AppCompat.Title" />
<RadioButton android:id="@+id/radio_darkbackground"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="onRadioButtonClicked"
android:layout_gravity="right"
android:gravity="right"/>
</LinearLayout>
、:
http://i.imgur.com/ArAEiZC.png
それを行うために、私は次のコードを試してみました私はlayout_gravityとgravityを "right"に入れましたが、うまく動作せず、このように見えます:
http://i.imgur.com/JDzwEJI.png
を試してみてください。最高の解決策は何ですか?どうもありがとうございました ! –
FrameLayoutは異なる目的で使用されるため、このデザインには相対レイアウトが最適です。 Z軸を操作するためのFrameLayoutの目的。つまり、ビュー要素を上下に積み重ねることができます。 – Masum