iOS UILabel行间距字间距
作者:
倪大头 | 来源:发表于
2019-11-30 16:06 被阅读0次NSMutableDictionary *attr = [NSMutableDictionary dictionary];
//字间距(NSKernAttributeName)
attr[NSKernAttributeName] = @5;
//行间距(NSParagraphStyleAttributeName)
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:5];
attr[NSParagraphStyleAttributeName] = paragraphStyle;
myLabel.attributedText = [[NSAttributedString alloc]initWithString:myLabel.text attributes:attr];
myLabel.numberOfLines = 0;
myLabel.lineBreakMode = NSLineBreakByWordWrapping;
本文标题:iOS UILabel行间距字间距
本文链接:https://www.haomeiwen.com/subject/oomowctx.html
网友评论