ios – 链接TTTAttributedLabel的轻击颜色

ios – 链接TTTAttributedLabel的轻击颜色,第1张

概述我在我的项目中使用了TTTAttributedLabel.我设法通过修改链接属性来更改我创建的任何链接的默认颜色和下划线. NSArray *pKeys = [[NSArray alloc] initWithObjects:(id)kCTForegroundColorAttributeName, (id)kCTUnderlineStyleAttribut 我在我的项目中使用了TTTAttributedLabel.我设法通过修改链接属性来更改我创建的任何链接的默认颜色和下划线.
NSArray *pKeys = [[NSArray alloc] initWithObjects:(ID)kCTForegroundcolorAttributename,(ID)kCTUnderlinestyleAttributename,nil];NSArray *pObjects = [[NSArray alloc] initWithObjects:pAlertcolor,[NSNumber numberWithInt:                                                                             kCTUnderlinestyleNone],nil];NSDictionary *plinkAttributes = [[NSDictionary alloc] initWithObjects:pObjects                                                                  forKeys:pKeys];self.alertMessage.linkAttributes = plinkAttributes;self.alertMessage.activelinkAttributes = plinkAttributes;

但是,我注意到,当我点击链接时,随着点击的任何其他链接,它会变红.我需要改变这种颜色.有什么线索可以怎么做?

解决方法 你会喜欢看看 TTTAttributedLabel documentation,特别是在activelinkAttributes

activelinkAttributes

@property (nonatomic,strong) NSDictionary *activelinkAttributes
discussion

A dictionary containing the NSAttributedString attributes to be
applIEd to links when they are in the active state. If nil or an empty
NSDictionary,active links will not be styled. The default active link
style is red and underlined.

Declared In

TTTAttributedLabel.h

总结

以上是内存溢出为你收集整理的ios – 链接TTTAttributedLabel的轻击颜色全部内容,希望文章能够帮你解决ios – 链接TTTAttributedLabel的轻击颜色所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1112412.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存