button1
以下は、左中央垂直とbutton2
右中央垂直に設定したいxmlですが、私にとってandroid:layout_gravity="center_vertical|right"
は何が問題なのですか?パディングやマージンを使って適用することでこれを達成できることは知っていますが、なぜそれが機能しないのかわかりません。どうすれば機能させることができますか?
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button1"
android:layout_gravity="center_vertical"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button2"
android:layout_gravity="center_vertical|right"/>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</RelativeLayout>
</FrameLayout>
</HorizontalScrollView>