我采用了Android MOB,我想使用不同大小的横幅,特别是对于较大的屏幕尺寸。我使用XML code这样做。有没有一种方法,我可以用XML来使其工作?我想使用XML这样我就可以把它作为我的风格在每一个屏幕大小的一个标准部分。谢谢!
示例XML code:
< com.google.ads.AdView机器人:ID =@ + ID / AD浏览报
广告:loadAdOnCreate =真的广告:adSize =大旗
广告:adUnitId =@字符串/ admob_unit_id
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_alignParentTop =真正的>< /com.google.ads.AdView>
解决方案
访问 HTTP:/ /developer.android.com/guide/practices/screens_support.html
这包含有关如何创建XML为不同的布局,根据屏幕大小的信息。
从那里,好像你可以再建议:adSize
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>
解决方案
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