Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrap Text in UITextField?

Does anyone 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...

like image 589
lab12 Avatar asked Jan 14 '10 22:01

lab12


People also ask

How do you wrap a text file?

Method 1. Go to the Home tab > Alignment group, and click the Wrap Text button: Method 2. Press Ctrl + 1 to open the Format Cells dialog (or right-click the selected cells and then click Format Cells…), switch to the Alignment tab, select the Wrap Text checkbox, and click OK.

What is Wraping of text?

To distort an image, often text, to conform to a variety of shapes. For instance, a line of text can be warped in the shape of an arc or wave.

How do I make text field bigger in Xcode?

Click the attribute inspector for the textField and then change the Border style to second one and you will be able to change the height.


1 Answers

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.

like image 199
Steve Harrison Avatar answered Nov 15 '22 23:11

Steve Harrison