我在我的屏幕中有UITableView
。它显示部分标题和行与动态高度。
当我从Xcode8.3移到Xcode-9 beta时,这个设置有两个问题。在Xcode-9 beta中破解的Autolayout
1接头视图高度破碎
2行的动态高度破碎
我已建立我的表视图为:
然后,我有自定义单元格
这里是代码:
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return //dynamically calculated height according to msg text
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 30
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let headerHeight:CGFloat = tableView.sectionHeaderHeight
let headerView = HeaderView(frame: CGRect(x: 0, y: 0, width: tableView.width, height: headerHeight), withHeaderLable: "Date/Day of msg")
return headerView
}
这完美的作品在Xcode8.3甚至含有消息的多条线路,但在Xcode9公测破为: 当我与Swift3.2设置运行在Xcode9测试:
当我在Xcode9赌注Swift4设置运行答:
什么是这种行为的原因是什么?
你为什么使用测试版? –
@elk_cloner这应该是问题,为什么使用测试版。这是一项采用即将到来的技术挑战的举措。如果这真的是Apple的缺陷,那么对我们来说,面对这样的挑战并找到适当的解决方案 – Krunal