开发者

Wrap Text in UITextField?

开发者 https://www.devze.com 2022-12-16 16:35 出处:网络
Does anyon开发者_如何学运维e know how to wrap text in a UITextField? I am using Cocoa/Objective-C in Xcode for my iPhone project, and I can not seem to find a way to do this...UITextField is meant for

Does anyon开发者_如何学运维e know how to wrap text in a UITextField? I am using Cocoa/Objective-C in Xcode for my iPhone project, and I can not seem to find a way to do this...


UITextField is meant for single-line text only. If you want multiple lines of text, then you'll have to use the UITextView class instead.

It's worth noting that UITextView inherits from UIScrollView, so if you don't want scrolling, you may want to stick with the UITextField and put up with the text being on one line... I once tried to subclass UITextView to make it like a multiple-line UITextField, but the UIScrollView made the task a nightmare—in the end I just went back to using a simple UITextField.

0

精彩评论

暂无评论...
验证码 换一张
取 消