Ios Xcode-9测试版中的自动布局被破坏

Ios Xcode-9测试版中的自动布局被破坏,ios,uitableview,autolayout,row-height,xcode9-beta,Ios,Uitableview,Autolayout,Row Height,Xcode9 Beta,我的其中一个屏幕中有UITableView。它显示具有动态高度的节标题和行 当我从Xcode8.3升级到Xcode-9测试版时,这个设置有两个问题 1页眉视图高度断裂 2断开行的动态高度 我已将我的表视图设置为: 然后我有定制手机 以下是代码: func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { return //dynami

我的其中一个屏幕中有
UITableView
。它显示具有动态高度的节标题和行
当我从Xcode8.3升级到Xcode-9测试版时,这个设置有两个问题

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中工作得非常完美,即使有多行MSG,但在Xcode9测试版中出现了以下问题: 当我在Xcode9测试版中使用Swift3.2设置运行时:

当我在Xcode9测试版中使用Swift4设置运行时:

这种行为的原因是什么

tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 30.0

将此添加到您的
viewDidLoad
中,不需要tableview委托方法
estimatedHeightForRowAt

为什么要使用beta?@elk\u cloner这应该是一个问题,为什么要使用beta。这是对即将到来的技术提出挑战的一项举措。如果这真的是苹果的错误,那么它将有助于我们面对这些挑战并找到合适的解决方案,直到我们想知道为什么它需要在xcode9中而不是在xcode8.3中这样做!实际上,标题问题与自动布局无关,它与NSFetchedResultsController有关;