Is there a way to use a variable ad banner size?

China☆狼群 提交于 2019-12-22 07:10:33

问题


I'm using Android MOB, and I'd like to use different sizes of banners, especially for the larger screen sizes. I'm using XML code to do so. Is there a way I can use XML to make it work? I'd like to use XML so I can just put it as a standard part of my styles for each of the screen sizes. Thanks!

Sample XML Code:

<com.google.ads.AdView android:id="@+id/adView" 
    ads:loadAdOnCreate="true" ads:adSize="BANNER" 
    ads:adUnitId="@string/admob_unit_id" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" ></com.google.ads.AdView>

回答1:


Visit http://developer.android.com/guide/practices/screens_support.html

That contains information about how to create xml for different layouts, based on screen size.

From there it seems like you could then ads:adSize




回答2:


http://code.google.com/intl/nl/mobile/ads/docs/android/intermediate.html

Google AdMob Ads supports three tablet-only banner sizes in addition to the 320x50 shown on phones: 320x50, 300x250, 468x60, 728x90



来源:https://stackoverflow.com/questions/6306594/is-there-a-way-to-use-a-variable-ad-banner-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!