Take a look at my answer here:
Alternative to UITextView
- create NSMutableAttributedString
- give it some attributes (apply to character ranges)
- set attribute property labelText
.
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString: @"monkey goat"]; [attString addAttribute: NSForegroundColorAttributeName value: [UIColor redColor] range: NSMakeRange(0,6)]; [attString addAttribute: NSFontAttributeName value: [UIFont fontWithName:@"Helvetica" size:15] range: NSMakeRange(0,6)]; [attString addAttribute: NSFontAttributeName value: [UIFont fontWithName:@"Didot" size:24] range: NSMakeRange(7,4)]; self.label.attributedText = attString;
foundry
source share