Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Admob not filling all the width

I have a problem with the admob banner size: My test terminals are Samsung Galaxy s (480x800) and Asus eee pad transformer (800x1200). In the admob doc the banner sizes im using are 320x50 for phones and 728x90 for tablets.

With 480x800 (and portrait) the add is expanded and fill all the layout but in landscape or with the tablet the banner only take a portion and the rest is black.

How can I fix that?

Thanks

like image 954
Addev Avatar asked Aug 15 '11 14:08

Addev


1 Answers

You have to set the flag SMART_BANNER in the adView attribute adSize. like that:

<com.google.ads.AdView
    android:id="@+id/adView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    ads:adSize="SMART_BANNER"
    ads:adUnitId="@string/admob_id"
    ads:loadAdOnCreate="true"
    ads:testDevices="@string/devices_id" />
like image 80
damson Avatar answered Sep 28 '22 17:09

damson