AdMob iOS banner offset error

I downloaded the latest AdMob SDK for iOS, but I have a problem with the banner offset, as shown in the following figure

picuter

Here is the code that I use to show its positioning

bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner]; // kGADAdSizeSmartBannerPortrait

CGRect bannerFrame = bannerView.frame;
bannerFrame.origin.y = [[UIScreen mainScreen] bounds].size.height - bannerFrame.size.height;
[bannerView setFrame:bannerFrame];
bannerView.adUnitID = AD_NOB_BANNER_UNIT_ID;
bannerView.rootViewController = self;
[self.view addSubview:bannerView];

[bannerView loadRequest:[GADRequest request]];

I set the background color to green and the background color of the banner to gray to check if it is positioned correctly or not. The correct cell position is {{0, 430}, {320, 50}}, but the banner has an incorrect offset.

If I go to him with my finger, I can scroll it up and it will fit the screen ... but its bias is wrong, if I scroll down, I see the same bias problem. Apparently, I did not find any way to set this offset.

Has someone encountered and solved the same problem?

+4
1

, iOS 7 UIWebView, .

, bannerView:

  UIView *view = [[UIView alloc] init];
  [self.view addSubview:view];

:

  UIView *view = [[UIView alloc] init];
  [self.view insertSubview:view belowSubview:bannerView];

, , , , iOS . bannerView.

+1

Source: https://habr.com/ru/post/1548519/


All Articles