ios - UITableViewCell 自动调整大小问题

标签 ios swift autolayout ios-autolayout

我有一个 UITableViewCell 我想调整其大小以适应内容。目前,它正在切断 UILabel 的所有文本。另外,它在滚动之前完全被切断,并且在滚动之后结果如下:

需要如何更改约束/内容拥抱属性才能使单元格大小正确?

enter image description here

理想情况下,UILabels 应将单元格的大小推得更大。

View Controller :

self.tableView.estimatedRowHeight = 75.0
self.tableView.rowHeight = UITableViewAutomaticDimension

最佳答案

最终以编程方式编写约束并放弃 Storyboard。 Snapkit 很不错。

关于ios - UITableViewCell 自动调整大小问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49468528/

相关文章:

ios - 如何在通过导航堆栈推送时为 View Controller 交叉溶解设置动画?

iOS - swift - 使用 AVFoundation 合并视频

ios - Swift 5 - 编辑文本字段隐藏键盘

ios - 添加topLayoutGuide后无法更改 View 的框架

ios - AutoLayout:removeFromSuperview/removeConstraints 抛出异常并严重崩溃

ios - 是否可以使用字节偏移量来定位源代码中我的 ios 崩溃堆栈跟踪的相关行?

ios - 应用内购买返回 0

ios - 代码 : Why same storyboard design display differently on simulator and device?

ios - 是否可以在第一列不动的情况下使 UICollectionView View 水平滚动?

ios - 以 Json 格式发布请求 iOS