enabling the "return button" in a UITextField keyboard (objective-c/iphone) enabling the "return button" in a UITextField keyboard (objective-c/iphone) objective-c objective-c

enabling the "return button" in a UITextField keyboard (objective-c/iphone)


UITextView and UITextField implement the UITextInputTraits Protocol. The protocol specifies a property called enablesReturnKeyAutomatically. Here's the description from the UITextInputTraits reference:

The default value for this property is NO. If you set it to YES, the keyboard disables the return key when the text entry area contains no text. As soon as the user enters any text, the return key is automatically enabled.

So, setting the property to NO after loading the TextField should do the trick.


Interface Builder folks uncheck Auto-enable Return Key in Attributes Inspector. :)