问题描述
我有一个 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
添加了一个名为 linkTextAttributes
的新属性,它似乎可以让您完全控制链接样式.
iOS 7 also added a new property to UITextView
called linkTextAttributes
which would appear to let you fully control the link style.
这篇关于我可以更改 UITextView 上自动检测到的链接的颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!