Given the following layout for a content view of a main activity
<?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 can't make AdMob's smart banners to work upon orientation change.
If I start in landscape mode, I get a smart banner of height 32. Changing orientation to portrait doesn't change layout_ad
height and I get this error
Not enough space to show ad. Needs 480x32 dp, but only has 320x455 dp.
No comments:
Post a Comment