1.宽度不够时
[_label1setContentCompressionResistancePriority:UILayoutPriorityRequiredforAxis:UILayoutConstraintAxisHorizontal];
2.宽度够时
[labelsetContentHuggingPriority:UILayoutPriorityRequiredforAxis:UILayoutConstraintAxisHorizontal];
1.宽度不够时
[_label1setContentCompressionResistancePriority:UILayoutPriorityRequiredforAxis:UILayoutConstraintAxisHorizontal];
2.宽度够时
[labelsetContentHuggingPriority:UILayoutPriorityRequiredforAxis:UILayoutConstraintAxisHorizontal];
本文标题:Masonry Label的宽度自适应
本文链接:https://www.haomeiwen.com/subject/mevscxtx.html
网友评论