gpt4 book ai didi

ios - 如何更改 UITextview UIDataDetectorTypeLink 的颜色?

转载 作者:可可西里 更新时间:2023-11-01 03:09:38 28 4
gpt4 key购买 nike

  1. 我将一些 url 传递给 UITextView 并且它们被检测到使用UIDataDetectorTypeLink。现在我需要改变颜色链接(url)到一些uicolor。我不知道该怎么做。

    这是显示我的尝试的代码:

    [textview_Url setEditable:NO];[textview_Url setScrollEnabled:NO];[textview_Url setDataDetectorTypes:UIDataDetectorTypeLink];[textview_Url setText:web];

    它给出蓝色,我想改变那个颜色。

  2. 通过 UIDataDetectorTypeLink,长按只要求确认重定向到链接。但我想表现出一些警惕来问确认是否有人刚刚触摸它。有办法做到这一点吗?

最佳答案

使用这个:

self.textView.linkTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};

关于ios - 如何更改 UITextview UIDataDetectorTypeLink 的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12634363/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com