2015-11-19 151 views
0

我的應用程序剛剛發佈。當我將它下載到iPhone 6上時,我注意到admob橫幅沒有填滿整個屏幕(請看附圖)。旗幟作品在iPad和iPhone 5的罰款,但不會是我的代碼我使用橫幅在iPhone 6Admob橫幅未填滿整個屏幕

這裏正常工作:

_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

回答

0

我用下面的代碼來創建Admob橫幅。它也可以在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]; 
}