Files
e-party-iOS/ui-demo.swift
edwinQQQ b35b6e1ce1 feat: 移除CreateFeedView-Analysis文档并新增用户协议组件以增强用户体验
- 删除CreateFeedView-Analysis.md文档以简化项目结构。
- 新增UserAgreementComponent以处理用户协议的显示和交互。
- 更新多个视图中的onChange逻辑以兼容iOS 17的新API用法,确保代码一致性和可维护性。
- 在Localizable.strings中新增用户协议相关的本地化文本,提升多语言支持。
2025-08-01 14:34:53 +08:00

16 lines
1.5 KiB
Swift

let label = UILabel()
let attrString = NSMutableAttributedString(string: "Agree to the "User Service Agreement" and "Privacy Policy"")
label.frame = CGRect(x: 71, y: 735, width: 256, height: 34)
label.numberOfLines = 0
let attr: [NSAttributedString.Key : Any] = [.font: UIFont(name: "PingFang SC-Regular", size: 12),.foregroundColor: UIColor(red: 1, green: 1, blue: 1, alpha: 1)]
attrString.addAttributes(attr, range: NSRange(location: 0, length: attrString.length))
view.addSubview(label)
let strSubAttr1: [NSMutableAttributedString.Key: Any] = [.font: UIFont(name: "PingFang SC-Regular", size: 12),.foregroundColor: UIColor(red: 1, green: 1, blue: 1,alpha:1)]
attrString.addAttributes(strSubAttr1, range: NSRange(location: 0, length: 13))
let strSubAttr2: [NSMutableAttributedString.Key: Any] = [.font: UIFont(name: "PingFang SC-Regular", size: 12),.foregroundColor: UIColor(red: 0.78, green: 0.35, blue: 1,alpha:1)]
attrString.addAttributes(strSubAttr2, range: NSRange(location: 13, length: 24))
let strSubAttr3: [NSMutableAttributedString.Key: Any] = [.font: UIFont(name: "PingFang SC-Regular", size: 12),.foregroundColor: UIColor(red: 1, green: 1, blue: 1,alpha:1)]
attrString.addAttributes(strSubAttr3, range: NSRange(location: 37, length: 5))
let strSubAttr4: [NSMutableAttributedString.Key: Any] = [.font: UIFont(name: "PingFang SC-Regular", size: 12),.foregroundColor: UIColor(red: 0.78, green: 0.35, blue: 1,alpha:1)]
attrString.addAttributes(strSubAttr4, range: NSRange(location: 42, length: 16))
label.attributedText = attrString