首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Admob大横幅位置

Admob大横幅位置
EN

Stack Overflow用户
提问于 2017-01-24 13:01:03
回答 1查看 102关注 0票数 0

我正在尝试使用大横幅而不是智能横幅,但我不能让它留在底部。我正在使用这段代码的智能横幅,它留在底部,但不工作的大横幅。当我从kGADAdSizeSmartBannerPortrait更改为kGADAdSizeLargeBanner时,横幅将移动到顶部。

代码语言:javascript
复制
     _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);
EN

回答 1

Stack Overflow用户

发布于 2017-01-24 13:51:09

您可以尝试使用此代码。

代码语言:javascript
复制
// 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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41820328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档