我想将firstLineHeadIndent
设置为多段UILabel
的第一段,我该怎么办
NSMutableParagraphStyle *paragraphStype = [[NSMutableParagraphStyle alloc] init];
paragraphStype.firstLineHeadIndent = 10.0f;
[att addAttribute:NSParagraphStyleAttributeName value:paragraphStype range:NSMakeRange(0, att.length)];
答案 0 :(得分:0)
尝试使用较小的范围:
NSMutableParagraphStyle *paragraphStype = [[NSMutableParagraphStyle alloc] init];
paragraphStype.firstLineHeadIndent = 10.0f;
[att addAttribute:NSParagraphStyleAttributeName value:paragraphStype range:NSMakeRange(0, 10)];