2011-07-07 16 views
0

私のアプリケーションでrelativeLayoutの問題に取り組んでいます。 イメージとボタンを1つ取ります。ボタンを画像の一番下にしたいのですが、設定されていません。相対レイアウトで重力が設定されていません

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
<ImageButton android:src="@drawable/layout_logo" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:id="@+id/image" /> 

<Button android:id="@+id/button3" 
     android:layout_height="wrap_content" 
     android:layout_width="fill_parent" 
     android:drawableBottom="@id/image" 
     android:gravity="bottom" /> 
</RelativeLayout> 

答えて

2

RelativeLayout他人に関して要素を位置決めするandroid:layout_aboveandroid:layout_belowを使用します。 android:gravity="bottom"android:layout_below="@id/image"に変更するとこれが解決されます。

関連する問題