// cell的高度设置
self.tableView.estimatedRowHeight = 44;
self.tableView.rowHeight = UITableViewAutomaticDimension;
// 注册cell
[self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([CommentCell class]) bundle:nil] forCellReuseIdentifier:CommentId];
UITableView自动计算cell的高度
最新推荐文章于 2020-06-17 17:27:45 发布
本文介绍如何为 UITableView 的 Cell 设置预估高度及自动调整高度,并演示了如何使用 Swift 进行 Cell 的注册过程。
8686

被折叠的 条评论
为什么被折叠?



