我有一个iOS应用程序almos完成,但我发现了一个错误。我有一个UITableView与单元格上的原型单元格和UILabel。在运行时,我将文本放在标签中,并使用方法sizeToFit()
来调整标签大小。这works fine on iOS8
但iOS7一个得到error of breaking constrains
和的UILabel根本就没有调整。UILabel sizeToFit突破限制只有在iOS 7
我需要你的帮助,它是我必须做发布的应用程序的唯一的事。
的约束:
UILabel to top of cell content - 10
UILabel to bottom of cell content - 10
UILabel to left of cell content - 5
UILabel to right of cell content - 5
P.S - 我没有做一个单元格高度定义的,我不使用method estimatedCellSize
。
为什么你需要调用sizeToFit? – Wain
由于在运行时添加了te文本,我不知道文本长度,所以我使用它来调整标签的大小以适应文本。 – EduardoNogueira
与Swing无关。请在对问题进行掌控之前**阅读**有用的标记弹出窗口。 –