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
discussionA 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的轻击颜色所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)