Admob横幅未填满全屏

时间:2015-11-19 17:04:29

标签: xcode admob

我的应用程序刚刚发布了。当我将它下载到iPhone 6时,我注意到admob横幅没有填满整个屏幕(查看附图)。横幅在iPad和iPhone 5上运行良好,但在iPhone 6上无法正常工作。

这是我用于横幅的代码:

_bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];

_bannerView_.frame = CGRectMake(0.0,
                               self.view.frame.size.height -
                               _bannerView_.frame.size.height,
                               _bannerView_.frame.size.width,
                               _bannerView_.frame.size.height);


_bannerView_.adUnitID = @"ID";
_bannerView_.rootViewController = self;

GADRequest *request = [GADRequest request];

[_bannerView_ loadRequest:request];

[self.view addSubview:_bannerView_];

有没有人看到任何问题或知道如何解决这个问题?提前致谢admob_banner

1 个答案:

答案 0 :(得分:0)

我使用下面的代码创建了Admob Banner。它在iPhone6中也运行良好。

-(void)createBannerAds
{
    //set up banner coordinates to display at the bottom
    CGPoint origin = CGPointMake(0.0,self.view.frame.size.height -kGADAdSizeSmartBannerPortrait.size.height);
    self.adBanner = [[[DFPBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait origin:origin] autorelease];

    self.adBanner.adUnitID = ADMOB_ID;
    self.adBanner.delegate = self;
    [self.adBanner setRootViewController:self];
    [self.view addSubview:self.adBanner];

    GADRequest *request = [GADRequest request];
    request.testDevices = @[@"600ecccd6a1c2a4750952facf253ea2f"];

    [self.adBanner loadRequest:request];
}