如何为第一段设置 NSMutableParagraphStyle firstLineHeadIndent

how to set NSMutableParagraphStyle firstLineHeadIndent for just first paragraph

我想为多段UILabel只设置第一段firstLineHeadIndent,我该怎么做

NSMutableParagraphStyle *paragraphStype = [[NSMutableParagraphStyle alloc] init];
paragraphStype.firstLineHeadIndent = 10.0f;
[att addAttribute:NSParagraphStyleAttributeName value:paragraphStype range:NSMakeRange(0, att.length)];

尝试使用较小的范围:

NSMutableParagraphStyle *paragraphStype = [[NSMutableParagraphStyle alloc] init];
paragraphStype.firstLineHeadIndent = 10.0f;
[att addAttribute:NSParagraphStyleAttributeName value:paragraphStype range:NSMakeRange(0, 10)];