使用NSMutableParagraphStyle实现label文字首尾的缩进
NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
paraStyle.alignment = NSTextAlignmentLeft;//对齐
paraStyle.headIndent = 0.0f;//行首缩进
//字体大小号字乘以2 即首行空出两个字符
CGFloat emptylen = 15 * 2;
paraStyle.firstLineHeadIndent = emptylen;//首行缩进
paraStyle.tailIndent = 100.0f;//行尾缩进
paraStyle.lineSpacing = 2.0f;//行间距
NSAttributedString *attrText = [[NSAttributedString alloc] initWithString:model.descr attributes:@{NSParagraphStyleAttributeName:paraStyle}];
_introduceLabel.attributedText = attrText;