在iOS11.2版本下测试iPhone5s模拟器中的所有功能。
一切都很好,但决定在iOS 9.1上测试应用程序,最终发现了一个奇怪的bug。以下是11.2版上的屏幕截图:

这是在版本9.1上:

正如您所看到的,ios 9.2只显示一行文本,并且在程序的所有部分。UILabel在任何地方都是以相同的方式描述的,看起来是这样的:
let titlePost: UILabel = {
let label = UILabel()
label.font = UIFont.systemFont(ofSize: 18, weight: UIFont.Weight.semibold)
label.numberOfLines = 0
return label
}() 这是什么原因呢?
发布于 2018-03-15 23:20:13
override func prepareForReuse() {
titlePost.sizeToFit()
shortContentPost.sizeToFit()
} 这就解决了问题。
https://stackoverflow.com/questions/49302504
复制相似问题