-
Notifications
You must be signed in to change notification settings - Fork 74
Known Issues
Xing edited this page Mar 24, 2023
·
10 revisions
NSDictionary *attributes = @{NSForegroundColorAttributeName: RGBHex(0x999999), NSFontAttributeName: [UIFont systemFontOfSize:13]};
label.attributedText = [[NSAttributedString alloc]initWithString:fullStr attributes:attributes];
创建超链接的富文本属性必须使用系统字体,如果使用苹方字体,比如[UIFont fontWithName:@"PingFangSC-Regular" size:13],则计算富文本的文本行数lines有问题,只会返回1,能正常展示,但是点击的indexOfCharacter 永远为-1,导致无法找到point,没有回调,这个有什么好的兼容办法吗?这个问题让找找了一整天,明明demo是正常点击,换为app需要设置的属性怎么就点击不了 FRHyperLabel *label = [[FRHyperLabel alloc] init]; label.numberOfLines = 0; NSDictionary *attributes = @{NSForegroundColorAttributeName: RGBHex(0x999999), NSFontAttributeName: [UIFont fontWithName:@"PingFangSC-Regular" size:13]}; label.attributedText = [[NSAttributedString alloc]initWithString:fullStr attributes:attributes];