Ore*_*ren 21 ios nsmutableattributedstring
我觉得我错过了一些简单的东西,但我似乎无法找到如何做到这一点:
我将属性设置为如下链接:
[myAttrString addAttribute:NSLinkAttributeName value:linkURL range:selectedRange];
Run Code Online (Sandbox Code Playgroud)
这是有效的,但链接是蓝色的,我似乎无法改变颜色.这将除了链接之外的所有内容设置为白色
[myAttrString addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:selectedRange];
Run Code Online (Sandbox Code Playgroud)
是否有其他颜色属性名称,我似乎无法找到特定于链接?
Jus*_*ser 63
UITextView设置UITextView的linkTextAttributes,像这样:
textView.linkTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
Run Code Online (Sandbox Code Playgroud)