Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发现自动检测 xib 文本字段中的链接和电话号码非常有用,
是否可以更改自动检测到的链接或号码的颜色?
在 UIWebView 中,检测到的数据只是呈现为一个链接,所以 CSS 会让你改变它。在 UITextView 中,没有进行更改的方法,所以我猜你不能。此外,您将链接设置为蓝色以外的颜色,这违反了 iOS GUI 指南。
如果您对更改链接颜色一无所知,那么我将在 UIWebView 而不是 UITextView 中呈现您的文本并使用 CSS。我不会尝试使用 UITextViews 和私有 API。