Android javaのxmlレイアウトってどうも初心者には分かりづらいです。
右寄せとかの時、つい調べてしまうのでメモ。
ImageViewを右寄せ。
<ImageView
android:layout_gravity="right"
android:layout_marginRight="10dp"
/>
TextView内のテキストを中央に配置
<TextView
android:gravity="center"
/>
下付き中央寄せ
<Button
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="16dp" />
ボタンを2つ均等に設置
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<Button
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginTop="6dp"
android:layout_marginLeft="16dp"
android:layout_weight="1"
android:text="X" />
<Button
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginTop="6dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="16dp"
android:layout_weight="1"
android:text="Y" />
</LinearLayout>