如何创建多行UITextfield? [英] How to create a multiline UITextfield?

查看:96
本文介绍了如何创建多行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 为此目的。

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屋!

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