我需要创建一些NSMutableAttributedString,并在UILabel中设置文本位置,如何在Swift中执行此操作? 结果应该是这样的 (x + y)³而是³一些文字 我写了一些代码
let stringTest = "(x+y)123"
let myRange = NSRange(location: 5, length: 3)
let myAttributeMainText = [ NSFontAttributeName: UIFont(name: "Arial", size: 18.0)! ]
let myAttributeDegreeText = [ NSFontAttributeName: UIFont(name: "Arial", size: 10.0)! ]
let myString = NSMutableAttributedString(string: stringTest, attributes: myAttributeMainText )
myString.addAttributes(myAttributeDegreeText, range: myRange)
testLabel.attributedText = myString
请帮我找到一种方法来提高UILabel顶部的最后3位数字