How to get Adview below Viewpager in CoordinatorLayout
You can add ViewPager and AdView inside RelativeLayout and specify android:layout_above=”@+id/adView” property to ViewPager so that adView doesn’t block the ViewPager contents. <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:ads=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”com.candyx.testapp.Activity”> <android.support.design.widget.CoordinatorLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:id=”@+id/main_content” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_above=”@+id/adView”> <android.support.design.widget.AppBarLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@drawable/main_button_background”> <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” app:layout_scrollFlags=”scroll|enterAlways”/> <android.support.design.widget.TabLayout android:id=”@+id/tabs” android:layout_width=”match_parent” android:layout_height=”wrap_content” app:tabMode=”scrollable” app:tabGravity=”fill” app:tabIndicatorColor=”@color/colorTabIndicator” app:tabIndicatorHeight=”3dp”/> … Read more