点击事件崩溃
FPJack opened this issue · comments
FPJack commented
adjustsFontSizeToFitWidth = true 的时候 一行展示不下的时候 文字里面有点击部分点击会崩溃
FPJack commented
let label = UILabel.init(frame: CGRect(x: 50, y: 100, width: 200, height: 20))
view.addSubview(label)
label.adjustsFontSizeToFitWidth = true
let attr1 = ASAttributedString(string: "I have read and agree the ",.font(.systemFont(ofSize: 10)),.foreground(.black))
let attr2 = ASAttributedString(string: "User Agreement ", .font(.systemFont(ofSize: 10)),.foreground(.orange),.action(ASAttributedString.Action(highlights: [.foreground(.orange.withAlphaComponent(0.5))]) { _ in
}))
let attr3 = ASAttributedString(string: "and ",.font(.systemFont(ofSize: 10)),.foreground(.black))
let attr4 = ASAttributedString(string: "Privacy Policy ",.font(.systemFont(ofSize: 10)),.foreground(.orange),.action(ASAttributedString.Action(highlights: [.foreground(.orange.withAlphaComponent(0.5))]) { _ in
}))
label.attributed.text = attr1 + attr2 + attr3 + attr4
LEE commented
已修复 3.3.5