NSTextField clicked link colour

不想你离开。 提交于 2019-12-22 17:04:11

问题


I have an NSTextField that contains an NSAttributedString which itself contains a clickable link.

I've change the colour of the link for my own styling, however when I click on it it becomes blue and underlined. How can I stop this?


回答1:


Seems that I'm not the only one with this problem, and there's a handy class to solve it:

https://github.com/laevandus/NSTextFieldHyperlinks




回答2:


This (http://developer.apple.com/library/mac/#qa/qa1487/_index.html) may help you. It will show you how to set/change the blue link color and the underlineAttribute. You may also have a look at the methods -linkTextAttributes and -setLinkTextAttributes: of an NSTextView.



来源:https://stackoverflow.com/questions/14366054/nstextfield-clicked-link-colour

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!