UILabel Multiple Lines
I have a UILable which displays text as I press buttons. The text is from
an attributed string. One of the buttons calls for a superscript
attribute:
string = [[NSMutableAttributedString alloc]initWithString:@"A"];
[string addAttribute:NSFontAttributeName value:(font)
range:NSMakeRange(string.length-1, 1)];
[string addAttribute:(NSString*)kCTSuperscriptAttributeName value:@"1"
range:NSMakeRange(string.length-1, 1)];
[string2 appendSttributedString: string];
label.attributedText = string2;
This code works as long as string2 fits onto one line in the UILable. When
the text begins to span two lines at first it appears as it should.
However when the kCTSuperscriptAttributeName superscript attribute is
added the second line of the label disappears and gets truncated. Im not
sure whats going on. Anyone have an idea?
No comments:
Post a Comment