【问题标题】:Dismissing UITableViewController changes ADBannerView location关闭 UITableViewController 会更改 ADBannerView 位置
【发布时间】:2016-02-06 13:47:26
【问题描述】:

我在UITableViewController 的最后一个中设置了ADBannerView,它在具有相同视图时可以正常工作,但是当我转到另一个视图并关闭它时,adview 大小会发生变化。

这里是代码

override func scrollViewDidScroll(scrollView: UIScrollView) {
    let tableBounds = tableView.bounds
    var bannerFrame = self.bannerView.frame

    bannerFrame = CGRect(x: tableBounds.origin.x, y: tableBounds.origin.y + CGRectGetHeight(tableBounds) - CGRectGetHeight(bannerFrame), width: tableBounds.size.width, height: bannerFrame.size.height)
    bannerView.frame = bannerFrame
}

之前

之后

【问题讨论】:

    标签: ios swift uitableview iad


    【解决方案1】:

    尝试替换

    let tableBounds = tableView.bounds
    

    let tableBounds = tableView.frame
    

    【讨论】:

      猜你喜欢
      • 2013-04-18
      • 2013-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-28
      • 2011-01-09
      相关资源
      最近更新 更多