There is a way to set different / multiple fonts and other properties on a shortcut using NSMutableAttributedString. Foll is my code:
UIFont *ArialFont = [UIFont fontWithName:@"arial" size:18.0]; NSDictionary *arialdict = [NSDictionary dictionaryWithObject: ArialFont forKey:NSFontAttributeName]; NSMutableAttributedString *AattrString = [[NSMutableAttributedString alloc] initWithString:title attributes: arialdict]; UIFont *VerdanaFont = [UIFont fontWithName:@"verdana" size:12.0]; NSDictionary *veradnadict = [NSDictionary dictionaryWithObject:VerdanaFont forKey:NSFontAttributeName]; NSMutableAttributedString *VattrString = [[NSMutableAttributedString alloc]initWithString: newsDate attributes:veradnadict]; [VattrString addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:(NSMakeRange(0, 15))]; [AattrString appendAttributedString:VattrString]; lblText.attributedText = AattrString;
Note that lblText is a UILabel, output as the owner of the file.
You can continue to add as many NSMutableAttributedString as he wants.
Also note that in my project, the font verdana and arial are added and a layer is added for this.
source share