Given the following layout to represent the contents of the main action
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".CordovaApp" tools:ignore="MergeRootFrame" > <LinearLayout android:id="@+id/layout_main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:layout_above="@+id/layout_ad" > </LinearLayout> <RelativeLayout android:id="@+id/layout_ad" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="vertical" > <com.google.android.gms.ads.AdView android:id="@+id/view_ad" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" ads:adSize="SMART_BANNER" ads:adUnitId="ca-app-pub-3940256099942544/6300978111" > </com.google.android.gms.ads.AdView> </RelativeLayout> </RelativeLayout>
I cannot get AdMob smart banners to work when changing orientation.
If I start in landscape mode, I get a smart banner with a height of 32. Changing the portrait orientation does not change the height of the layout_ad , and I get this error
Not enough space to display ads. It requires 480x32 dp, but has only 320x455 dp.
Adriano di giovanni
source share