#pragma mark ==== Underlined text attributeString too set on email, addres labels =====
+(NSMutableAttributedString *)underLinedText :(NSString *)normalString
{
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:normalString];
[attributeString addAttribute:NSUnderlineStyleAttributeName
value:[NSNumber numberWithInt:1]
range:(NSRange){0,[attributeString length]}];
return attributeString;
}
//To use this attributeString
//To use this attributeString
textLabel.attributedText = [Self underLinedText: @"http://www.gmail.com"] ;
For Multiple Color Use
[attributeString addAttribute: NSForegroundColorAttributeName
value: [UIColor redColor]
range: NSMakeRange(10, 1)];
For Multiple Color Use
[attributeString addAttribute: NSForegroundColorAttributeName
value: [UIColor redColor]
range: NSMakeRange(10, 1)];
No comments:
Post a Comment