在UITextField中键入时,请保持占位符静态 [英] Keep the Placeholder static while typing in UITextField

查看:95
本文介绍了在UITextField中键入时,请保持占位符静态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在键入时使占位符保持静态.在我们开始输入UITextField时,使用iOS的默认行为,占位符会消失.在此先感谢.

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.

推荐答案

对此我有简单的方法.

UITextField下添加UILabel并设置UITextField clearColor,然后根据需要设置UILabel文本,并将该文本颜色设置为与占位符颜色相同.

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 .

这篇关于在UITextField中键入时,请保持占位符静态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆