我阅读的所有教程都说如果要使用cells,footer,动态高度的页眉,则需要在下面的行中使用。
tableView.estimatedRowHeight = 60
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedSectionHeaderHeight = 20
tableView.sectionHeaderHeight = UITableView.automaticDimension
tableView.estimatedSectionFooterHeight = 20
tableView.sectionFooterHeight = UITableView.automaticDimension
我有一个视图控制器,它是UITableViewController的子类,一切正常(Autodimension正常)。但是我没有写以上行。 只是想知道UITableViewController是否为我们这样做?
答案 0 :(得分:1)
是的,如果您不需要对表进行任何自定义,则默认情况下,UITableViewController会为您执行此操作。请检查以下屏幕截图,您将获得XCode为您完成此操作的图片