I want to change the hyperlink color inside UITextView. The default colour is blue with a underline on the text. (I am doing data type detection for phone numbers/addresses/emails) Is there a way to change the color ? Please let me know.
开发者_StackOverflowThanks.
It is a pretty tricky task to almost impossible to change the behavior of the built in UITextView
.
dataDetectorTypes
docs:
You can use this property to specify the types of data (phone numbers, http links, and so on) that should be automatically converted to clickable URLs in the text view. When clicked, the text view opens the application responsible for handling the URL type and passes it the URL.
And I don't think that's the behavior you're looking for.. (tapping the link will always open the app) - this would also go against the HIG.
I would recomment you to have a look at the following question: Can I change the color of auto detected links on UITextView?
精彩评论