【发布时间】:2015-05-26 08:36:54
【问题描述】:
我无法让视图的宽度适应不同屏幕尺寸的表格视图的尺寸
这是我在 viewDidLoad() 上的代码
view.tableView.registerNib(UINib(nibName: "Header", bundle: NSBundle.mainBundle()), forHeaderFooterViewReuseIdentifier: "Header")
在 Table View Delegate 上:
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
var cell = tableView.dequeueReusableHeaderFooterViewWithIdentifier("Header") as! Header
// etc
}
请记住,我不想将它放在情节提要中,并且我正在使用自动布局。
有什么建议吗?
【问题讨论】:
标签: ios iphone uitableview autolayout xib