调整包含 UICollectionView 的 UITableViewCell 大小的示例
自动调整表视图大小包含 UI 的单元格
POC 的想法是验证是否可以不定义单元格高度并让自动调整大小时使用UITableView.automaticDimension
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
实际 | 预期 |
---|---|
File:
TableViewController: Contains the , implements DataSource methodsUITableView
CollectionViewCellTableViewCell: This is a that contains the it is register the and implements the UITableViewCell
UICollectionView
UICollectionViewCell
UICollectionViewDataSource
CollectionViewCell: The cell that is used by the UICollectionView