@property(nonatomic,strong) YYLabel *protocolContent;
_protocolContent = [[YYLabel alloc]initWithFrame:CGRectMake(23, _protocolName.bottom + 10, bkView.width - 46 , 270)];
_protocolContent.textVerticalAlignment=YYTextVerticalAlignmentTop;
NSString *protocol = @"在您正式注册并开始使用“【商城】”App、相关程序及网站前,您需要与我们以在线形式签署以下两份重要协议:《商城用户协议》及《商城隐私政策》。请完整、仔细阅读本协议下的条款和条件,特别是其中约定了责任限免的条款、文字加粗内容及争议解决条款,该等内容将会对您产生实质性的影响。我们向您提供的服务还需要您遵守其他条款及服务准则(包括但不限于《商城退换货或退款规则》等,简称“服务规则”),您应同时阅读了解并予以一并接受。";
NSMutableAttributedString *attri_str=[[NSMutableAttributedString alloc] initWithString:protocol];
//设置字体颜色
[attri_str setFont:[UIFont systemFontOfSize:14]];
[attri_str setColor:[UIColor colorWithHexString:@"333333"]];
NSRange ProRange = [protocol rangeOfString:@"《商城用户协议》"];
//设置下划线
[attri_str setTextUnderline:[YYTextDecoration decorationWithStyle:YYTextLineStyleSingle] range:ProRange];
[attri_str setTextHighlightRange:ProRange color:[UIColor color:@"#4099E3"] backgroundColor:[UIColor whiteColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
MailWebViewVc *vc=[[MailWebViewVc alloc] init];
vc.navtitle=@"商城用户协议";
vc.urlStr= [NSString stringWithFormat:@"%@moreInfo?type=1",WebUrl];
[[Tool currentController].navigationController pushViewController:vc animated:YES];
}];
[bkView addSubview:_protocolContent];