当我更改字距时,样式会重置。例如,当我更改文本大小或颜色时,它被保存,但是当我更改字距时,样式 UITextView 被重置
@IBAction func sizeTextEdit(_ sender: Any) {
self.textOne?.font = UIFont.systemFont(ofSize: CGFloat(sizeText.value * 1))
}
@IBAction func kernTextEdit(_ sender: Any) {
let textString = textOne.text
let attrs: [NSAttributedString.Key : Any] = [.kern: kernText.value]
textOne?.attributedText = NSAttributedString(string: textString!, attributes: attrs)
}
正如你在第一个截图中看到的,我增加了字体,然后我增加了字母之间的距离,字体大小被重置