美文网首页
UILable 多行(“\n”)高度不正确(autoLayout

UILable 多行(“\n”)高度不正确(autoLayout

作者: amisarex | 来源:发表于2017-07-03 16:36 被阅读16次

问题现象:使用“\n”显示多行文本时,UILabel高度比文字实际高度要大。

10036B25-8415-4F36-A653-A30C1152CFDF.png

问题原因:UILabel属性preferredMaxLayoutWidth设置不合适(问题是因为设置值小于理想值)

问题解决:计算并设置preferredMaxLayoutWidth值

同样的问题:[http://www.jianshu.com/p/d5d897ffe118]

相关文章

网友评论

      本文标题:UILable 多行(“\n”)高度不正确(autoLayout

      本文链接:https://www.haomeiwen.com/subject/tfczcxtx.html