如何创建多行UITextfield? [英] How to create a multiline UITextfield?
问题描述
我正在开发一个用户必须写一些信息的应用程序。为此我需要一个 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).
当我在使用Google搜索时,我找到了使用 UITextView
代替 UITextfield $的答案c $ c>为此目的。
As I'm Googling I find a answer of using UITextView
instead of UITextfield
for this purpose.
推荐答案
UITextField
特别是一个-line only。
UITextField
is specifically one-line only.
您的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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!