Reputation: 721
Hello i have this layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:src="@drawable/head"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:id="@+id/image1"
/>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/scan"
android:text=""
android:layout_below="@+id/image1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/mio_ad">
</LinearLayout>
</RelativeLayout>
there's no way i can put my #mio_ad at the bottom: it remains at the top. how can i? thanks.
Upvotes: 6
Views: 12645
Reputation: 22291
Use Below XML Code for that, it may help you.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/llayout"
android:layout_above="@+id/mio_ad">
<ImageView
android:src="@drawable/head"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:id="@+id/image1"/>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/scan"
android:text=""
android:layout_below="@+id/image1" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/mio_ad"
android:layout_alignParentBottom="true" >
</LinearLayout>
</RelativeLayout>
Upvotes: 3