在cocos2dx中按照官方文档加入Admod.启动应用在eclipse日志显示“Ad finished loading”,但是界面中cocos admob 消失不显示。现在我们就看看cocos admob 消失的解决方案。

经过Google解决方案如下


1   adView.loadAd(adRequest);
2   adView.setBackgroundColor(Color.BLACK);
3   addContentView(adView,adParams);

4   adView.setBackgroundColor(0);


参考网址:

http://discuss.cocos2d-x.org/t/cocos2dxglsurfaceview-hide-my-addview-withusing-admob-for-android-device/11458/6

http://stackoverflow.com/questions/22277904/adview-not-appear-in-android-cocos2dx


摘抄:
ymkimwizard
 18 Feb
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 answoer.
This just my own isseu? Kindly can you check my source code.
Why,First Time, I can't see admob screen.
  ymkimwizard
 23 Feb
Hello.
I found solution. This is not JNI issue.
Simpley, 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 infomation can you refer below
http://stackoverflow.com/questions/17975659/how-to-duplicate-sprite-of-sprites-in-cocos2d-x-2-1-44