Reputation: 99
I have problem with an Admob ad overlapping the button and text view field in my Relative Layout. How do I get it below the enter text field and button area?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
tools:context=".Chat_Room">
<EditText
android:id="@+id/room_name_edittext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_toLeftOf="@+id/btn_add_room"
android:layout_toStartOf="@+id/btn_add_room"/>
<Button
android:id="@+id/btn_add_room"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:text="Select group above"/>
<ListView
android:id="@+id/listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/room_name_edittext"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:gravity="bottom"
android:orientation="horizontal"
android:layout_above="@+id/btn_add_room"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
<com.google.android.gms.ads.AdView
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
How do I put the adview bottom of the screen below edit text and button?
Upvotes: 0
Views: 342
Reputation: 23881
Add this to your Button: android:layout_above="@+id/add"
and remove: android:layout_alignParentBottom="true"
<Button
android:id="@+id/btn_add_room"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/add"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="5dp"
android:text="Select group above" />
Upvotes: 1