【发布时间】:2017-05-04 08:27:10
【问题描述】:
我的 tableView 设置
appTableView.estimatedRowHeight = 200
appTableView.rowHeight = UITableViewAutomaticDimension
然后我设置单元格的高度
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath == kFirstCellIndexPath && category == .overtime {
return CGFloat.leastNormalMagnitude // it will crash
return 0 // it will not crash
} else {
return UITableViewAutomaticDimension
}
}
当我重新加载tableView,但它是崩溃,为什么?
【问题讨论】:
-
错误日志是什么?
-
因为 CGFloat.leastNormalMagnitude 将返回负值所以。
-
@KKRocks 你能解释一下细节吗?
标签: ios swift uitableview