| | |
| | | |
| | | |
| | | textView_treaty.isEditable = false |
| | | textView_treaty.linkTextAttributes = [.foregroundColor:UIColor.black.withAlphaComponent(0.8)] |
| | | let paragraphStyle = NSMutableParagraphStyle() |
| | | paragraphStyle.lineBreakMode = NSLineBreakMode.byCharWrapping |
| | | paragraphStyle.lineSpacing = 3 |
| | |
| | | let attribute = NSMutableAttributedString(string: content) |
| | | attribute.addAttribute(.foregroundColor, value: UIColor.black.withAlphaComponent(0.6), range: NSRange(location: 0, length: content.count)) |
| | | attribute.addAttribute(.font, value: UIFont.systemFont(ofSize: 12, weight: .medium), range: NSRange(location: 0, length: content.count)) |
| | | attribute.addAttributes([NSAttributedString.Key.link:URL(string: "tip://treaty")!,.foregroundColor:UIColor(hexStr: "0078CD")], range: content.jq_subRange("《隐私协议》")!) |
| | | attribute.addAttributes([NSAttributedString.Key.link:URL(string: "tip://treaty")!], range: content.jq_subRange("《隐私协议》")!) |
| | | attribute.addAttributes([NSAttributedString.Key.link:URL(string: "tip://user")!], range: content.jq_subRange("《用户协议》")!) |
| | | attribute.addAttributes([NSAttributedString.Key.link:URL(string: "tip://sportSafety")!], range: content.jq_subRange("《运动安全告知书》")!) |
| | | attribute.addAttributes([.paragraphStyle:paragraphStyle], range: _NSRange(location: 0, length: content.count)) |