2017-01-24 10 views
0

私はスマートバナーの代わりに大きなバナーを使用しようとしていますが、それを底に留めることはできません。私はスマートバナーのためにこのコードを使用しています、そして、それは底にとどまりますが、大きなバナーのためには機能しません。 kGADAdSizeSmartBannerPortraitからkGADAdSizeLargeBannerに変更すると、バナーが上部に移動します。Admob大きなバナーの位置

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

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

答えて

0

このコードで試すことができます。

// Initialize the banner docked to the bottom of the screen. 
// We start in a portrait orientation so use kGADAdSizeSmartBannerPortrait. 
    CGPoint origin = CGPointMake(0.0, 
           self.view.frame.size.height - 
           CGSizeFromGADAdSize(
            kGADAdSizeSmartBannerPortrait).height); 

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

//Continue rest of initialization here 

参考:スマートバナーのための作品上記http://googleadsdeveloper.blogspot.in/2012/06/keeping-smart-banner-docked-to-bottom.html

+0

私のコード、それだけで大きな横断幕のために動作しません、私はあなたのコードを試してみましたが、それはどちらかの大型バナーには機能しません。 –

関連する問題