问题描述
我使用的是谷歌的AdMob广告SDK 4.0.4 Android版
I'm using Google AdMob Ads SDK 4.0.4 for Android
在默认情况下,AD浏览报不会有任何大小,直到该广告被加载。其中,如果你有高于或低于广告按钮可能引起的问题。
By default, The AdView will have no size until the ad is loaded. Which could cause problem if you have buttons above or below the ad.
用户可能会意外地点击广告,如果广告在返回的确切时刻,他们将要点击一个按钮。
User could accidentally click on the ad if the ad returned at the exact moment they are about to click a button.
在旧的AdMob SDK我用setGoneWithoutAd(假)解决了这一点。这样一来,空间将即使不退还广告尚未preserved。
In old admob SDK I solved this by using setGoneWithoutAd(false). This way, the space will be preserved even when the ad is not returned yet.
在新的SDK(谷歌Admob的广告SDK 4.0.4),我管理由做同样的使用这个快速修复:通过把广告中的一些布局预留空间有宽度=320dp和高度=50dp
In the new SDK (Google Admob Ads SDK 4.0.4) I manage to do the same byusing this quick fix: reserve the space by putting ad in some layout thathas width="320dp" and height="50dp"
<LinearLayout
android:layout_width="320dp"
android:layout_height="50dp" >
<com.google.ads.AdView android:id="@+id/adview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxxxxxxx"
ads:adSize="BANNER"/>
</LinearLayout>
它的工作原理,但我不知道这是否是一个正确的方法。(我会碰到了著名的没有足够的空间来显示广告!的问题?)
It works but I'm not sure if this is a proper method.(Will I run into the famous "Not enough space to show ad!" issue? )
要总结的问题:如何(正常),使AD浏览报占据的空间,即使同时要求广告
To sum up the question: How to(properly) make AdView "occupy" space even while requesting an ad?
感谢你在前进!
推荐答案
您是否尝试过:
<com.google.ads.AdView android:id="@+id/adview"
android:layout_width="320dip"
android:layout_height="50dip"
ads:adUnitId="xxxxxxxxxxx"
ads:adSize="BANNER"/>
我用AdWhirl为我的广告我和我的方式把它与类似这样的尺寸固定的固定视图。看起来你已经将它设置为包装的内容使没事的时候在那里的视线中消失。试试吧,让我知道它是如何工作的。
I use AdWhirl to serve my ads for me and the way I have it is with a fixed view similar to this with fixed dimensions. Looks like you have it set to wrap content making the view disappear when nothing's there. Try it out and let me know how it works out.
这篇关于如何使AD浏览报&QUOT;占领&QUOT;甚至同时要求广告空间? (安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!