美文网首页swift开发技术
swift修改UITextfield的Placeholder字体

swift修改UITextfield的Placeholder字体

作者: 摸摸头发 | 来源:发表于2021-02-24 14:39 被阅读0次

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

相关文章

网友评论

    本文标题:swift修改UITextfield的Placeholder字体

    本文链接:https://www.haomeiwen.com/subject/qadsfltx.html