我可以在UITextView上更改自动检测到的链接的颜色吗? [英] Can I change the color of auto detected links on UITextView?
问题描述
我有 UITextView
来检测电话号码和链接,但这会覆盖我的 fontColor
并将其更改为 blueColor
。有没有办法格式化自动检测链接的颜色,或者我应该尝试这个函数的手动版本吗?
I had a UITextView
that detects phone numbers and links, but this overrides my fontColor
and change it to blueColor
. Is there a way to format the color of auto detected links, or should I try a manual version of this function?
推荐答案
开iOS 7你可以设置 UITextView
的 tintColor
。它会影响链接颜色以及光标线和选定的文本颜色。
On iOS 7 you can set the tintColor
of the UITextView
. It affects the link color as well as the cursor line and the selected text color.
iOS 7还为 UITextView $添加了新属性c $ c>名为
linkTextAttributes
,它可以让您完全控制链接样式。
iOS 7 also added a new property to UITextView
called linkTextAttributes
which would appear to let you fully control the link style.
这篇关于我可以在UITextView上更改自动检测到的链接的颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!