Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone UITextField: how to insert new line by the return key?

I want to get a carriage return/new line by hitting the return key on an UITextField's keyboard. I've found out, that textFieldShouldReturn gets called.

But how do I insert a carriage return in the text field?

like image 423
Stefan Avatar asked Apr 27 '09 13:04

Stefan


1 Answers

You want to use a UITextView instead. UITextFields are meant for single line input whereas UITextViews support multi-line input.

like image 162
Martin Gordon Avatar answered Nov 14 '22 22:11

Martin Gordon