1、sizeToFit,立即改变view的frame ,view画完之后才会执行rect
2、自适应布局
boundingRectWithSize
sizeWithAttributes [showText sizeWithAttributes:@{NSFontAttributeName:kFontPF(8)}]
3、不给label添加宽度约束,
1、sizeToFit,立即改变view的frame ,view画完之后才会执行rect
2、自适应布局
boundingRectWithSize
sizeWithAttributes [showText sizeWithAttributes:@{NSFontAttributeName:kFontPF(8)}]
3、不给label添加宽度约束,
转载于:https://www.cnblogs.com/beautylcy/p/7683313.html