Swift修改UITextfield的Placeholder字体大小和颜色

字体大小

textField.attributedPlaceholder = NSAttributedString.init(string:"请输入您的密码", attributes: [NSAttributedString.Key.font:UIFont.systemFont(ofSize:15)])

字体颜色

textField.attributedPlaceholder = NSAttributedString.init(string:"请输入您的密码", attributes: [NSAttributedString.Key.foregroundColor:UIColor(resource:.gray600)])

你可能感兴趣的:(Swift,swift,开发语言,ios)