如何修复文本字段中的标签?

时间:2022-09-06 20:51:00

I'm new on iOS, i'm working on an application which has some text fields. I want that when user click on text field for enter text the label(place holder) should not be removed.i would like my text fields as displayed in this image

我是iOS的新手,我正在开发一个有一些文本字段的应用程序。我希望当用户点击文本字段输入文本时,不应删除标签(占位符)。我希望我的文本字段显示在此图像中

Any suggestion or sample code will be appreciated. Thanks.

任何建议或示例代码将不胜感激。谢谢。

1 个解决方案

#1


1  

UILabel and UITextField are two different classes. You need to build view with static UILabel (User Interaction: NO) and UITextField for entering user provided content. It's easy job with Interface Builder.

UILabel和UITextField是两个不同的类。您需要使用静态UILabel(用户交互:否)和UITextField构建视图,以输入用户提供的内容。 Interface Builder非常简单。

#1


1  

UILabel and UITextField are two different classes. You need to build view with static UILabel (User Interaction: NO) and UITextField for entering user provided content. It's easy job with Interface Builder.

UILabel和UITextField是两个不同的类。您需要使用静态UILabel(用户交互:否)和UITextField构建视图,以输入用户提供的内容。 Interface Builder非常简单。