Sunday, 8 September 2013

Adjust text underline leading

Adjust text underline leading

I want to move the underline on a line of text down (away from the text),
i,e. adjust the leading. But this doesn't work:
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]
init];
paragraphStyle.lineSpacing = 5.0f;
NSMutableAttributedString *string = [[NSMutableAttributedString alloc]
initWithString:@"Something"];
[string addAttribute:NSUnderlineStyleAttributeName value:[NSNumber
numberWithInt:NSUnderlineStyleSingle] range:NSMakeRange(0,
string.length)];
[string addAttribute:NSParagraphStyleAttributeName value:paragraphStyle
range:NSMakeRange(0, string.length)];
Is it possible?

No comments:

Post a Comment