There is a markup. ScrollView calls on AdView . Tell AdView how to make AdView , and the rest of the part is occupied by ScrollView ?

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" 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:background="@drawable/bg" android:padding="10dp"> <ScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <com.makeramen.roundedimageview.RoundedImageView android:id="@+id/imgBludo" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:src="@drawable/no_image" app:riv_border_color="@color/brown" app:riv_border_width="2dp" app:riv_corner_radius="4dp" /> <TextView android:id="@+id/txtName" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:background="@drawable/background_corners" android:gravity="center" android:padding="10dp" android:text="TextView" android:textColor="@color/brown" android:textSize="16sp" android:textStyle="bold" /> <TextView android:id="@+id/txtIngredients" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:background="@drawable/background_corners" android:padding="10dp" android:text="TextView" android:textColor="@color/brown" /> <TextView android:id="@+id/txtDescription" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:background="@drawable/background_corners" android:padding="10dp" android:text="TextView" android:textColor="@color/brown" /> </LinearLayout> </ScrollView> <com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" /> </RelativeLayout> 

    1 answer 1

    You need android:layout_below

     <ScrollView ... android:layout_below="@id/adView">