Hide placeholder Programatically using swift 3x

孤人 提交于 2020-01-14 05:51:04

问题


How to hide the placeholder of TextField programmatically using Swift 3x ?


回答1:


You can not hide the placeholder of UITextField, but you can set it to empty String.

self.textField.placeholder = ""

Now textField doesn't show any placeholder later on if you want to show the placeholder simply set it with String that you want.

self.textField.placeholder = "Enter name"


来源:https://stackoverflow.com/questions/41421850/hide-placeholder-programatically-using-swift-3x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!