问题描述
我正在开发一个应用程序,用户必须在其中编写一些信息.为此,我需要一个多行的 UITextField
(通常 UITextField
是单行).
I am developing an application where user has to write some information. For this purpose I need a UITextField
which is multi-line (in general UITextField
is a single line).
当我在谷歌上搜索时,我找到了一个使用 UITextView
而不是 UITextfield
来达到这个目的的答案.
As I'm Googling I find a answer of using UITextView
instead of UITextfield
for this purpose.
推荐答案
UITextField
特别是一行.
您的 Google 搜索是正确的,您需要使用 UITextView
而不是 UITextField
来显示和编辑多行文本.
Your Google search is correct, you need to use UITextView
instead of UITextField
for display and editing of multiline text.
在 Interface Builder 中,在需要的位置添加 UITextView
并选择可编辑"框.默认为多行.
In Interface Builder, add a UITextView
where you want it and select the "editable" box. It will be multiline by default.
这篇关于如何创建多行 UITextfield?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!