cocos admob 消失
在 Cocos2d-x 中按照官方文档集成 AdMob 后,启动应用时,Eclipse 日志显示 “Ad finished loading”,但界面中 Admob 广告却不显示。下面我们就来探讨 Cocos Admob 消失问题的解决方案。
解决方案
经过 Google 搜索,找到如下解决方案:
adView.loadAd(adRequest);adView.setBackgroundColor(Color.BLACK);addContentView(adView, adParams);adView.setBackgroundColor(0);
参考资源
相关案例摘抄
ymkimwizard 在 2 月 18 日的发言
Hello everyone. I'll try to display admob on Android Device. Curiously, When I run my game. First Time, I can't see addView screen. But Lock and UnLock, If I come back my game. Then I can see addView without any problem. I'm searching many code snip. But I don't find correct answer. This just my own issue? Kindly can you check my source code. Why,First Time, I can't see admob screen.
ymkimwizard 在 2 月 23 日的发言
Hello. I found solution. This is not JNI issue. Simply, This is come from admob with using google play service. For solving this issue, I just add below line
adView.loadAd(adRequest);
adView.setBackgroundColor(Color.BLACK);
addContentView(adView, adParams);
Then without any problem, From application starting, I can see admob view. Thanks. If you need further information can you refer below Stack Overflow:如何在 Cocos2d-x 2.1.4 中复制精灵