0

This article shows how to add admob banner in your libgdx game through robovm. https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx It actually did.But when I open my game,admob banner will appear at the top of the view and can't be removed.That is a problem because I plan to use IAP to remove ad in my game.I have tried a lot of functions and they could not solve the problem. the functions include:

adview.setFrame(new CGRect(0, -bannerHeight, bannerWidth, bannerHeight));
    adview.close();
    adview.release();
    adview.dispose();
    adview.removeFromSuperview();

I have no idea now.can you help me? Thanks you in advance.

2 Answers2

0

adView.pause(); will pause serving of ads.

adView.setVisible(View.GONE); will hide the AdView.

layout.removeView(adView); will remove the AdView from your layout.

William
  • 20,150
  • 8
  • 49
  • 91
  • Your code appears to be Android not iOS, and you didn't mention in your question that you were looking for any platform specific advice. – William Jul 19 '14 at 02:13
  • he said robovm in his title... which is a bridge to iOS from Java. I'm also looking for this answer – islander_zero Oct 23 '14 at 10:59
0

I solved this by calling:

adview.removeFromSuperview();

In case you need to add it back, just call:

iosApplication.getUIViewController().getView().addSubview(adview);

again (I do this because I hide the banner during the game and just show it on the WorldMap).

jeudyx
  • 767
  • 1
  • 8
  • 17