我在我的项目中使用TTTAttributedLabel。我已设法更改默认颜色并为我通过修改链接属性创建的任何链接加下划线。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;
但是,我已经注意到,当我点击链接时,它会随着任何其他链接点击时瞬间变成红色。我需要改变这种颜色。任何线索可以做到这一点?
由于球员..我为activeLinkAttributes设置相同的链接属性,它就起作用了。 (基本上我不希望链接颜色改变)。我曾看到activeLinkAttributes,但不知道这会帮助我。 – StudentX 2015-02-09 14:34:02