我的以下代码是
NSMutableParagraphStyle *body1stParagraph = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
body1stParagraph.alignment = NSTextAlignmentCenter;
body1stParagraph.minimumLineHeight = _font_Size;
attrs = @{ NSFontAttributeName : [UIFont fontWithName:font_name size:Font_size],
NSParagraphStyleAttributeName : body1stParagraph,
NSAttachmentAttributeName: textAttachment};
此字典添加归因字符串
[attributeString addAttributes:attrs range:lineRange];
但标签的文字是剪切
答案 0 :(得分:0)
这可能会解决您的问题 -
yourLabel.sizeToFit()