【发布时间】:2014-10-01 10:30:18
【问题描述】:
self.tableView.contentInset = UIEdgeInsetsMake(232, 0, 232, 0)
有没有办法在 Storyboard 中进行设置?
【问题讨论】:
标签: ios uitableview uistoryboard
self.tableView.contentInset = UIEdgeInsetsMake(232, 0, 232, 0)
有没有办法在 Storyboard 中进行设置?
【问题讨论】:
标签: ios uitableview uistoryboard
【讨论】:
UIViewController 的automaticallyAdjustsScrollViewInsets 属性。
UITableView的。 UILabel 本身不支持内容插入。请参阅此处获取解决方案:stackoverflow.com/questions/19437579/…
是的,UITableView 是 UIScrollView 的子类,它的 contentInset 属性是 UIScrollView 的属性,所以在 UIScrollView 的部分找到它。
对于 Xcode 6 更新:
我认为我可以在Xcode 6中设置contentInset的原因是因为该项目是在Xcode 6之前创建的。所以如果在Xcode 6及更高版本中创建项目,则不能设置contentInset。我认为这是因为在 iOS 7 中 UIViewController 会相应地调整此属性。看看automaticallyAdjustsScrollViewInsets 的UIViewController。
【讨论】:
在 XIB 中,UIScrollView 的 contentInset 键路径,值的组织顺序与 UIEdgeInsets 构造函数相同:
{{top, left}, {bottom, right}}
UIEdgeInsets(top: 100, left: 0, bottom: 100, right: 0)
【讨论】: