考慮下面的佈局主要活動智能旗幟容器視圖不會調整
<?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>
我不能讓AdMob的智能橫幅在方向變化工作的內容視圖。
如果我在橫向模式下啓動時,我得到高度32.修改方向爲縱向不改變layout_ad
高度的智能旗幟,我得到這個錯誤
沒有足夠的空間來顯示廣告。需要480x32 DP,但只有320x455 DP。
它抱怨的是寬度而不是高度。 – William 2014-11-03 21:38:29
http://stackoverflow.com/questions/20929963/admob-ad-not-resizing-correctly-upon-screen-orientation-includes-pictures和http://stackoverflow.com/questions/11281562/android- admob-resize-on-landscape – 2015-04-08 14:35:47