I am using SMART_BANNER in an android project. It works correctly in portrait mode, but when you change the orientation (in landscape orientation), the banner width remains the same. This is my ad layout:
<LinearLayout
android:id="@+id/adLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#000000"
android:orientation="vertical" >
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="SMART_BANNER"
app.backgroundColor ="#000000"
ads:adUnitId="xxxxxxx"
android:gravity="center" >
</com.google.android.gms.ads.AdView>
</LinearLayout>
I also tried android:layout_width="wrap_content"for LinearLayout, which contains a banner and android:layout_width="match_parent"for AdView - nothing happens.
source
share