我们在自定义表格视图单元格中显示一些数据,但如果一些标签为空,我们将隐藏标签并在估计的行高中使用 uitableview.automaticdimension 但效果不佳。提前致谢
宣布于
func viewDidLoad() {
self.cabinetVC.estimatedRowHeight = 260
self.cabinetVC.rowHeight = UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
}