-1
私はリニアレイアウトの向きを持っています:水平 今、2つのテキストビューを隣り合わせに追加して右揃えにする方法はありますか?アクティビティの右側に2つのテキストビューを並べます。
私はリニアレイアウトの向きを持っています:水平 今、2つのテキストビューを隣り合わせに追加して右揃えにする方法はありますか?アクティビティの右側に2つのテキストビューを並べます。
あなたはRelativeLayout
とし、このようなXMLを使用することができます
<RelativeLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right">
<TextView
android:id="@+id/foo_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/question_recline" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/foo_bar"
android:layout_toRightOf="@id/foo_bar"
android:text="Text" />
</RelativeLayout>
リニアレイアウト内のテキストビューに android:gravity="right"
を使用して、それはそれを行う必要があります。
それとも、全体の線形レイアウトを右揃えにしたい場合は、
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right" >
.
.
</LinearLayout>
のように直線的なレイアウトでそれを使用していあなたのための私の解決策の仕事? –