
设计样式

代码执行结果
查找半天无果,最后发现 在给label赋textLayout或attributedText之后需要重新赋一次对齐方式:
xxxxL.attributedText = text;
// xxxxL.textLayout = layout;
xxxxL.textAlignment = NSTextAlignmentCenter;
另外,numbeOfLines属性也有次情况,例如根据不同情况对行数进行不同限制也要如此操作:
xxxxL.attributedText = text;
// xxxxL.textLayout = layout;
xxxxL.numberOfLines = 5;
文章均来自互联网如有不妥请联系作者删除QQ:314111741 地址:http://www.mqs.net/post/14853.html
添加新评论