I am passing some urls to the UITextView and they are detected using UIDataDetectorTypeLink. Now I'm in need to change the color of the link(url) to some uicolor. I have no idea on how to do this.
Here is the code showing my attempt:
[textview_Url setEditable:NO]; [textview_Url setScrollEnabled:NO]; [textview_Url setDataDetectorTypes:UIDataDetectorTypeLink]; [textview_Url setText:web];
It gives blue, and I want to change that color.
By UIDataDetectorTypeLink, a long press only asks conformation to redirect to the link. But I want to show some alert to ask confirmation if someone just touches it. Is there a way to do this ?
Solved
I have used globalTintColor property of window,
like,
self.window.tintColor = [UIColor redColor];
Output:
Use this:
self.textView.linkTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
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