how to set NSMutableParagraphStyle firstLineHeadIndent for just first paragraph

936 views Asked by At

I want set firstLineHeadIndent for only first paragraph for a multi-paragraph UILabel, how can I do

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

There are 1 answers

0
Bannings On BEST ANSWER

Try to use smaller range:

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