How can i set banner on bottom of the screen ?
I tried with RelativeLayout and it stay bottom, but outside screen.
That's my simple code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_home"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical">
<LinearLayout
android:id="@+id/layout_body"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background2"
android:orientation="vertical">
......
</LinearLayout>
<RelativeLayout
android:id="@+id/layout_banner"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
....
</RelativeLayout>
</LinearLayout>
UPDATE
I have set android:layout_alignParentBottom="true" but not change
Use below XMl Code for Display Banner in Bottom Part.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_home"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background">
<LinearLayout
android:id="@+id/layout_body"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background2"
android:orientation="vertical"
android:layout_above="@+id/layout_banner">
......
</LinearLayout>
<RelativeLayout
android:id="@+id/layout_banner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
....
</RelativeLayout>
</RelativeLayout>
Put your banner inside the RelativeLayout and use android:layout_alignParentBottom="true"
Check the solution in: https://stackoverflow.com/a/5380447/1434631
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With