我已在我的回收站 View 中实现了 Admob Native Express 广告。如果没有可用的互联网,它会在列表中保留空白,直到广告加载为止。如何隐藏该空白区域直到广告加载? 谢谢
最佳答案
只需实现 AdListener监听 onAdLoaded
事件。
The
onAdLoaded
method is executed when an ad has finished loading. If you want to delay adding the AdView to your activity or fragment until you're sure an ad will be loaded, for example, you can do so here. If you're using a third-party analytics package to track impressions, this is also where you can place the call to record one.
mAdView.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
// HERE!!!!!!
}
});
注意没有必要override all methods
AdListener provides a default empty implementation for all of its ad lifecycle events. You only need to override the ad events you wish to implement.
关于java - 如何在回收站 View 中隐藏广告 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38068364/