Note that there are some explanatory texts on larger screens.

plurals
  1. POAdmob pushing view down on iPad only how can I stop it?
    text
    copied!<p>I am using Admob mediation in my app, basically, the view has a space at the top reserved for a banner.</p> <p>So my code, allows the banner to be told where to go, when on iPad, and iPhone.</p> <p>It works perfectly on my iPhone, and oddly this works on many of my other apps on both iPad and iPhone, yet for some reason, on this one, for the iPad only, it creates an extra part at the top of the screen, so instead of the banner being at the top, its the banner, then a small gap, of say 30 pixels (approximately) and this pushes the screen down so it looks horrid!</p> <p>Here is the code used to call, any ideas? If I remove the iPad part of that banner view the view is loaded fine, so it must be something in that code.</p> <pre><code>- (void)viewDidLoad{ if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait]; bannerView_.adUnitID = MY_BANNER_UNIT_ID; CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; CGFloat screenHeight = screenRect.size.height; CGFloat screenXPos = (screenWidth /2); CGFloat screenYPos = screenHeight - 980; [bannerView_ setCenter:CGPointMake(screenXPos, screenYPos)]; bannerView_.rootViewController = self; bannerView_.adUnitID = MY_BANNER_UNIT_ID; bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; }else{ bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait]; bannerView_.adUnitID = MY_BANNER_UNIT_ID; CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; CGFloat screenHeight = screenRect.size.height; CGFloat screenXPos = (screenWidth /2); CGFloat screenYPos = screenHeight - 455; [bannerView_ setCenter:CGPointMake(screenXPos, screenYPos)]; bannerView_.rootViewController = self; bannerView_.adUnitID = MY_BANNER_UNIT_ID; bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; [super viewDidLoad]; self.navigationController.navigationBarHidden=YES; isCharging = FALSE; isFull = FALSE; count =0; } </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload