NSTextField 单击链接颜色 [英] NSTextField clicked link colour
本文介绍了NSTextField 单击链接颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 NSTextField
,它包含一个 NSAttributedString
,它本身包含一个可点击的链接.
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?
推荐答案
看来我不是唯一遇到这个问题的人,有一个方便的类来解决它:
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
这篇关于NSTextField 单击链接颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文