Created
May 24, 2016 09:35
-
-
Save anil826/1917fdd8d19eda930707d78e2b962a98 to your computer and use it in GitHub Desktop.
differenct color in same lable using objective C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//AtrributedString for different color. | |
NSString *str = [NSString stringWithFormat:@"You Have Selected %@", treeModel.name]; | |
NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:str]; | |
[message addAttribute: NSForegroundColorAttributeName value:[UIColor blackColor] range:[str rangeOfString:[NSString stringWithFormat:@"%@",treeModel.name]]]; | |
cell1.descriptionLabel.attributedText = message; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment