swift uitextfield placeholder color
swift – Set UITextField placeholder color programmatically – Stack Overflow
ios – Changing Placeholder Text Color with Swift – Stack Overflow
然后代码:
let ColorTextFieldPlaceholderGray:UIColor = UIColor(hexString: "#C0C0C0")! let attributedUserPlaceholder = NSAttributedString(string: "手机号", attributes: [NSForegroundColorAttributeName : ColorTextFieldPlaceholderGray]) userTextField.attributedPlaceholder = attributedUserPlaceholder |
效果:
转载请注明:在路上 » [已解决]swift设置文本框占位符的文字颜色