swift开发技术

swift修改UITextfield的Placeholder字体

2021-02-24  本文已影响0人  摸摸头发

//字体大小
textField.attributedPlaceholder = NSAttributedString.init(string:"输入你需要的服务", attributes: [NSFontAttributeName:UIFont.systemFont(ofSize:15)])
//字体颜色
textField.attributedPlaceholder = NSAttributedString.init(string:"输入你需要的服务", attributes: [
NSForegroundColorAttributeName:UIColor.red])

上一篇 下一篇

猜你喜欢

热点阅读