I am tackling relativeLayout problem in my application. I take one image and button. I want to make button is bottom of the image but is not set.
<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="wr开发者_开发技巧ap_content"
android:layout_width="fill_parent"
android:drawableBottom="@id/image"
android:gravity="bottom" />
</RelativeLayout>
RelativeLayout
uses android:layout_above
and android:layout_below
to position elements with regard to others. Changing your android:gravity="bottom"
to android:layout_below="@id/image"
should fix this.
精彩评论