self.setValue(placeHolderColor,forKeyPath:"_placeholderLabel.textColor")
在ios13中,它的crashed.how将placeholderColor设置为placeholderLabel in swift5 for ios13 in xcode11。
发布于 2019-09-25 12:09:35
使用color设置attributedPlaceholder,如下所示
let colorAttrbs: [NSAttributedString.Key: Any] = [.foregroundColor: UIColor.red]
textField.attributedPlaceholder = NSAttributedString(string: "placeholder", attributes: colorAttrbs)https://stackoverflow.com/questions/58097838
复制相似问题