“字符”不可用:请直接使用字符串

时间:2019-07-25 23:52:26

标签: arrays swift

遇到字符错误,请帮忙

func setupBrightnessLabel() {
    self.brightnessLabel = UILabel()
    self.brightnessLabel.translatesAutoresizingMaskIntoConstraints = false
    let text = "BRIGHTNESS"
    let attributedString = NSMutableAttributedString(string:text)
    attributedString.addAttribute(NSAttributedString.Key.kern, value:labelCharacterSpacing, range: NSMakeRange(0, text.characters.count))
    self.brightnessLabel.attributedText = attributedString
    self.brightnessLabel.textColor = labelTextColor
    self.brightnessLabel.font = labelFont
}

0 个答案:

没有答案