Issue
Neither test nor live ads are taking full width of the device when using Admob banner ads.
This is the adView
that i've declared in my layout xml:
<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 rendered:
Solution
Change
ads:adSize="BANNER"
to
ads:adSize="SMART_BANNER"
Smart Banners are new ad units (as of v6.0.0) that will render screen-wide banner ads on any screen size across different devices in either orientation. Smart Banners help deal with increasing screen fragmentation across different devices by "smartly" detecting the width of the phone in its current orientation, and making the ad view that size.
Answered By - Viral Patel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.