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).

As I'm Googling I find a answer of using UITextView instead of UITextfield for this purpose.

推荐答案

UITextField is specifically one-line only.

Your Google search is correct, you need to use UITextView instead of UITextField for display and editing of multiline text.

In Interface Builder, add a UITextView where you want it and select the "editable" box. It will be multiline by default.

Ios相关问答推荐

使用UIGraphicsBeginIMAext创建新图像会扭曲图像 colored颜色

由于已存在同名项目,因此无法将Mapbox.xcframework-ios.sign复制到Signature中

如何在SwiftUI中将图像整合到文本标签中间?

如何在KMM项目中处理PHPickerViewController的回调?

Flutter 应用程序中带有Firebase的GoogleService-Info.plist中缺少CLIENT_ID、REVERSED_CLIENT_ID和ANDROID_CLIENT-ID

如何在Combine发布者之间强制执行最小延迟

应用程序被杀死时如何在 flutter ios 应用程序中播放音频?

在我的 M1 上出现 Architecture arm64 问题,因此我无法运行我的旧项目

使用 AVCaptureDeviceTypeBuiltInTripleCamera 时 Select 合适的相机进行条码扫描

具有线性渐变的 SVG textPath 在 Safari 中损坏

撤销 Apple 登录令牌以进行帐户删除过程

如何在 SwiftUI 的 TabView 中添加底部曲线?

以正确的方式在 Text() 中使用 colored颜色

如何 comments .plist 文件中的行?

iOS - 确保在主线程上执行

有没有办法在 xib 文件中的视图和顶部布局指南之间添加约束?

在滚动视图中使用动态大小的控制器调整容器视图的大小

SwiftUI - 列表行中的多个按钮

如何为 UILabel 的背景 colored颜色 设置动画?

在两个或多个 iPhone 应用程序之间共享数据