我使用TTTAttributedLabel来显示标签中的链接。 现在我想改变链接的字体大小。任何指南
答案 0 :(得分:3)
TTTAttributedLabel
有一个属性linkAttributes
,它将应用于每个链接:
TTTAttributedLabel *someLabel;
NSMutableDictionary *baseAttributes = [NSMutableDictionary dictionary];
UIFont *baseFont = [UIFont systemFontOfSize:14.0];
CTFontRef baseFontRef = CTFontCreateWithName((__bridge CFStringRef)baseFont.fontName, baseFont.pointSize, NULL);
baseAttributes[(__bridge NSString *)kCTFontAttributeName] = (__bridge id)baseFontRef;
CFRelease(baseFontRef);
someLabel.linkAttributes = baseAttributes;