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.
Change the color of a hyperlink Select the hyperlink you want to re-color. (How do I insert a hyperlink?) On the Home tab of the ribbon, select the Font Color arrow to open the menu of colors. Select the color you want for the hyperlink.
You can Change the Hyperlink Color in a TextView by the following: In the Nib file, you can go to the Properties Window and change the Tint to which ever color you want to.
Click Page Design, and then click the More arrow next to the Schemes gallery. Click Create New Color Scheme. In the Create New Color Scheme dialog box, under New, click the arrow next Main to change the body text color or Hyperlink to change the color of the hyperlink text.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With