Skip to content
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

Closed
kusmi opened this issue Mar 31, 2016 · 7 comments
Closed

Links are always blue #45

kusmi opened this issue Mar 31, 2016 · 7 comments
Assignees
Milestone

Comments

@kusmi
Copy link

kusmi commented Mar 31, 2016

It does not matter what color I supply to _linkAttributes, the URL stays blue, e.g.

_linkAttributes = @{ NSForegroundColorAttributeName: [UIColor greenColor],
NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle) };

➔ Blue

@kusmi
Copy link
Author

kusmi commented Mar 31, 2016

mhh after further investigation it seems to be a bug in UILabel - other attributes get applied, just not this text color...

@Coeur
Copy link
Collaborator

Coeur commented Mar 31, 2016

Can you try @{ (NSString *)kCTForegroundColorAttributeName: [UIColor greenColor], NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle) }?

@kusmi
Copy link
Author

kusmi commented Mar 31, 2016

I tried but it does not work. I only tried in Simulator...

On 31.03.2016, at 18:44, Antoine Cœur notifications@github.com wrote:

Can you try @{ (NSString *)kCTForegroundColorAttributeName: [UIColor greenColor], NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle) }?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@Coeur
Copy link
Collaborator

Coeur commented Mar 31, 2016

A green link: https://upload.wikimedia.org/wikipedia/en/3/39/Wakerlink.jpg

@Coeur
Copy link
Collaborator

Coeur commented Apr 29, 2016

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.

@Coeur Coeur self-assigned this Apr 30, 2016
@Coeur Coeur modified the milestones: 2.0.4, 2.0.2 Apr 30, 2016
@Coeur
Copy link
Collaborator

Coeur commented Apr 30, 2016

@kusmi I will provide a small workaround. But my guess is that you are not supporting clickable links anyway?

@Coeur Coeur modified the milestones: 2.1.0, 2.0.4 May 1, 2016
Coeur added a commit that referenced this issue May 1, 2016
#45]

* Added partial support for remote image URL. [#16]
* Added HeaderDoc support
@Coeur
Copy link
Collaborator

Coeur commented May 1, 2016

@kusmi, please give a try to version 2.1.0 and parameter skipLinkAttribute.

@Coeur Coeur closed this as completed May 1, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants