I am using UITextView
and i want to change the color of hyperlink which i use in this component. For example if UITextView
is showing www.gmail.com then it shows up in blue color. I want to change that color.
Huzzah! Apple have released a proper solution with iOS7! As explained in this answer you can use the linkTextAttributes
property of a UITextView
. A white, underlined link would look something like this:
yourTextView.linkTextAttributes = @{
NSForegroundColorAttributeName: [UIColor whiteColor],
NSUnderlineStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle]
};
or alternatively you could change the tintColor
, since UITextView
inherits from UIView
and uses the tintColor
property to colour links - see:
yourTextView.tintColor = [UIColor whiteColor];
Now your links can look epic!