Admob bannner ads don't accept full width

No test or live ads use the full width of the device when using Admob banner ads.

This is the adView that I declared in my xml layout:

 <com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:gravity="bottom" ads:adSize="BANNER" ads:adUnitId="@string/banner_ad_unit_id"></com.google.android.gms.ads.AdView> 

This is what is displayed:

enter image description here

+6
source share
2 answers

+ Change

 ads:adSize="BANNER" 

in

 ads:adSize="SMART_BANNER" 

Smart banners are new ad units (starting from version 6.0.0) that will display advertising banners in full screen on any screen on different devices in any orientation. Smart banners help to cope with the growing fragmentation of the screen on different devices, smartly determining the width of the phone in its current orientation and forcing ads to view this size.

Find out more here.

+25
source

You can use FULL_WIDTH

ads:adSize="FULL_WID50" example ads:adSize="FULL_WID50"

0
source

Source: https://habr.com/ru/post/1240926/


All Articles