I'm trying to place an adview at the bottom of every screen by injecting a fragment into a container. I can get the adview to be at the top, below the action bar, by using a LinearLayout. I've tried various combinations of RelativeLayout, but none seem to make the resizing-on-orientation adview stick.
Here's the layout that works for up top:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
xmlns:ads="http://schemas.android.com/apk/res-auto"
>
<com.google.android.gms.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"/>
</LinearLayout>
And I add fragments to fragmentContainer
. How can I make the adview statically positioned at the bottom of the screen? I've tried various layout nesting strategies and none have worked so far.
The banner should not overlay or cut off any part of the fragment.