Keep the Placeholder static while typing in UITextField

天涯浪子 提交于 2019-12-11 09:44:53

问题


I want to keep the placeholder static while typing. With the default behaviour of iOS as soon as we start typing in the UITextField the placeholder disappears.Thanks in advance.


回答1:


I have Simple way for this .

Add UILabel below UITextField and set UITextField clearColor .and set your UILabel text as you required and set that text color same as placeholder color .




回答2:


You can't because it's not only in IOS but also all the textField have the same property starting from IOS to HTML. As soon as the value entered into textfield placeholder will be hide and vice versa. But if you really need to show the placeholder text after typing then @Darshan Kunjadiya's answer is simple and best.



来源:https://stackoverflow.com/questions/24523665/keep-the-placeholder-static-while-typing-in-uitextfield

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