user1774316
user1774316

Reputation: 393

Enable Return Key in empty UITextView

In my app, I need to enable Return Key on UITextView even if UITextView is empty. By default, return key is disabled, before user not entered any symbols. How I can do this?

Thanks.

Upvotes: 5

Views: 6264

Answers (1)

Kjuly
Kjuly

Reputation: 35131

I need to enable Return Key on UITextView even if UITextView is empty.

Actually, the return key is enabled by default no matter the text view is empty or not. However, if you want to set the return key to disabled by default, you need to set the enablesReturnKeyAutomatically to YES. As the Apple Doc said:

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.

Upvotes: 16

Related Questions