2016-04-18 11 views

答えて

0

あなたは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> 
1

リニアレイアウト内のテキストビューに android:gravity="right"を使用して、それはそれを行う必要があります。

それとも、全体の線形レイアウトを右揃えにしたい場合は、

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:gravity="right" > 
    . 
    . 
</LinearLayout> 
関連する問題