I want to set two colors for UILabel's text. I tried TTTRegexAttributedLabel, but it is throwing unknown type error.
I tried following code too. But it is crashing at settext.
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Hello. That is a test attributed string."];
[str addAttribute: @"Hello" value:[UIColor yellowColor] range:NSMakeRange(3,5)];
[str addAttribute:@"That" value:[UIColor greenColor] range:NSMakeRange(10,7)];
[str addAttribute:@"Hello" value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:20.0] range:NSMakeRange(20, 10)];
[syncStatusLabel setText:(NSString *)str];
Is there any other way to set multiple colors for single UILabel text?
you can set text color with pattern image like bellow..
and also set different color with this bellow code.. please check tutorial with detail mate..
for more information see this tutorial….
coretext-tutorial-for-ios-part
i hope this help you…