1

我正在使用 TTTAttributedLabel 在标签中显示链接。现在我只想更改链接的字体大小。任何指南

4

1 回答 1

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;
于 2013-04-11T13:43:48.397 回答