NSDictionary * attDic = [NSDictionary dictionaryWithObjectsAndKeys:RGBCOLOR(31, 132, 204),NSForegroundColorAttributeName,[NSNumber numberWithInteger:NSUnderlineStyleSingle],NSUnderlineStyleAttributeName,@“url”,NSLinkAttributeName, nil];

 

如果想要跳转viewController

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange
{
    if ([URL.scheme isEqualToString:@"url"]) {
        // Launch View controller
        return NO;
    }
    return YES;
}

====
label 的富文本好像不能直接添加点击事件

相关文章:

  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-02-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案