ios - 我们可以为具有动态高度的 UITableViewCell 使用 XIB 吗?

标签 ios swift uitableview

我正在尝试使用 custom TableView cell 创建一个 TableView 并为 Image 创建一个 multiple XIB,其他用于 Text + Video。但是必须在界面中为 XIB 预定义高度。

那么如何为我的具有动态高度的 UITableViewCell 提供 XIB?

最佳答案

在你的 viewDidLoad 中试试这个:

yourTableView.estimatedRowHeight = yourTableViewCellHeight yourTableView.rowHeight = UITableViewAutomaticDimension

关于ios - 我们可以为具有动态高度的 UITableViewCell 使用 XIB 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41937833/

相关文章:

ios - 与所有可能的实体有一个共享按钮 IoS

ios - indexOfObjectsPassingTest 或 filteredArrayUsingPredicate 哪个性能更快?

ios - 使用ObjC block 作为CGDataProviderCreateWithData的回调

ios - 检测 collectionViewCell 内的设备旋转

ios - 导航栏的实时模糊效果 - 状态栏无法进入

ios - URLSession.Datatask 返回 0 字节数据

ios - 如何在 Swift 中从 Firestore 获取对象数组?

iphone - 为 UITableView 设置三边边框 - IOS

objective-c - iOS - 防止用户将可排序的 UITableViewCell 拖动到顶行

ios - 如何快速返回 SqLite 的多行或表?