Commit 65c02626 authored by David黄金龙's avatar David黄金龙

修改几处bug

parent 9389de9b
......@@ -7,6 +7,7 @@
//
import UIKit
import AttributedString
class YHOtherSingleChoiceItemView: UIView {
override init(frame: CGRect) {
......@@ -101,6 +102,32 @@ extension YHOtherSingleChoiceItemView {
isSelected = model.select
setViewSelected()
if !model.subname.isEmpty,!model.highlight.isEmpty {
if #available(iOS 16.0, *) {
let arr = model.subname.split(separator: model.highlight)
if arr.count == 2 {
let aa: ASAttributedString = .init(NSAttributedString(string: String(arr[0])), .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x8993A2)))
let bb: ASAttributedString = .init(NSAttributedString(string: model.highlight), .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.failColor))
let cc: ASAttributedString = .init(NSAttributedString(string: String(arr[1])), .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x8993A2)))
descLabel.attributed.text = aa + bb + cc
} else {
descLabel.attributed.text = nil
descLabel.text = model.subname
}
} else {
descLabel.attributed.text = nil
descLabel.text = model.subname
}
} else {
}
}
func setViewSelected() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment