frénésie
frénésie

Reputation: 1762

How to set a UITextField to edit severals lines?

I have a UITextField that is 300px width and 270px height. When I want to edit it, the cursor goes automatically in the middle and I can only write on the middle line. How can I set this UITextField to have severals lines and a cursor starting at the top-left ?

Upvotes: 0

Views: 174

Answers (2)

Asif Mujteba
Asif Mujteba

Reputation: 4656

UITextfield is designed for single line only, If you want to enter multi line text than use UITextView instead and set its editable property to YES than it would behave like textfield!

[myTextView setEditable:YES]; 

Note: You can also set it via Interface Builder, select the "editable" box & It will be multiline by default.

Upvotes: 0

Kjuly
Kjuly

Reputation: 35131

Simple answer, just use UITextView instead.

Upvotes: 3

Related Questions