我正在尝试使用大横幅而不是智能横幅,但我不能让它留在底部。我正在使用这段代码的智能横幅,它留在底部,但不工作的大横幅。当我从kGADAdSizeSmartBannerPortrait更改为kGADAdSizeLargeBanner时,横幅将移动到顶部。
_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);发布于 2017-01-24 13:51:09
您可以尝试使用此代码。
// 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
https://stackoverflow.com/questions/41820328
复制相似问题