I am working on an Android project, and I had a problem so that the ad would appear at the bottom of the screen under the list without causing any overlap.
Currently, if there are a large number of elements in the list view that cause scrolling, it is assumed that the ad will appear below the list view, but at the moment the ad sits at the top of the list, so the user does not see what is at the bottom of the list.
Below is a copy of my XML layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/black"
android:orientation="vertical" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/password_noRecords"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="center"
android:text="There are currently\nno saved logins"
android:textSize="20dp"
android:textStyle="bold|italic"/>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ListView>
<Button android:id="@+id/password_clearSearch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/password_clear_search"
android:layout_alignParentBottom="true"
android:visibility="gone"/>
</LinearLayout>
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
ads:adUnitId="a14d6125d95c70b"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, 015d1884222bfe01"/>
</RelativeLayout>
I have many different ways: all this is inside the relative layout, instead of having a different linear layout, without parent bottom = true alignment, but then it sits at the top of the list, overlapping everything at the top of the View list.
, .