-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Links are always blue #45
Comments
mhh after further investigation it seems to be a bug in UILabel - other attributes get applied, just not this text color... |
Can you try |
I tried but it does not work. I only tried in Simulator...
|
For UILabel, according to https://www.cocoanetics.com/2015/03/customizing-uilabel-hyperlinks/ you have no way to customize the attributes of a link. The workaround is to subclass UILabel with a lot of complex changes. You can give a try to https://github.com/Krelborn/KILabel or https://github.com/TTTAttributedLabel/TTTAttributedLabel. For UITextView, the link color is controlled by the tintColor property. For NSTextView, the link color is controller by the linkTextAttributes property. |
@kusmi I will provide a small workaround. But my guess is that you are not supporting clickable links anyway? |
@kusmi, please give a try to version 2.1.0 and parameter skipLinkAttribute. |
It does not matter what color I supply to _linkAttributes, the URL stays blue, e.g.
_linkAttributes = @{ NSForegroundColorAttributeName: [UIColor greenColor],
NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle) };
➔ Blue
The text was updated successfully, but these errors were encountered: