Closed Liguoju closed 11 months ago
let matrix = CGAffineTransformMake(0, 0, CGFloat(tanf(10 * Float(M_PI) / 180)), 1, -1, 0) ///字体描述 let desc: UIFontDescriptor = UIFontDescriptor(name: "Helvetica",matrix: matrix) let boldItalicDescriptor = desc.withSymbolicTraits([.traitBold, .traitItalic]) let font = UIFont(descriptor:boldItalicDescriptor!,size: 16) attributeText.addAttribute(.font, value: font, range: item.text?.rangeOf(of: oldText) ?? NSMakeRange(0,item.text?.count ?? 0 ))
自测可以了
YYLabel 字符串是中文时候,设置斜体不生效,英文和数字斜体是生效的,请问怎么解决。 我的电话是+8613041167877. attributeText.addAttributes([NSAttributedString.Key.obliqueness: 0.9], range: item.text?.rangeOf(of: oldText) ?? NSMakeRange(0,item.text?.count ?? 0 ))