Soorej Babu
Soorej Babu

Reputation: 368

How to display enter key in iOS keypad for textView (objective c)

I want to display enter key on keyboard instead of return key. Because i want user to type in a texView. We know that there is no keypad return in textView. Generally, i want to replace the "return" key with "enter". Normally in textView, the return key works as enter. So i need the return key labeled as enter. Is it possible?

Upvotes: 0

Views: 985

Answers (3)

Yatendra
Yatendra

Reputation: 1306

You cannot set custom text for the return key on iOS. There are a number of options but those are the only ones.

Upvotes: 1

dpigera
dpigera

Reputation: 3369

Try using the returnKeyType attribute:

UITextField *textField = [[UITextField alloc] init];
textField.returnKeyType = UIReturnKeyTypeDone

Here are the available options:

typedef NS_ENUM(NSInteger, UIReturnKeyType) {
    UIReturnKeyDefault,
    UIReturnKeyGo,
    UIReturnKeyGoogle,
    UIReturnKeyJoin,
    UIReturnKeyNext,
    UIReturnKeyRoute,
    UIReturnKeySearch,
    UIReturnKeySend,
    UIReturnKeyYahoo,
    UIReturnKeyDone,
    UIReturnKeyEmergencyCall,
    UIReturnKeyContinue NS_ENUM_AVAILABLE_IOS(9_0),
};

Upvotes: 1

Govind Prajapati
Govind Prajapati

Reputation: 957

You can't set Enter But You can set a numbers of default key for keyboard instead of return from storyboard.In you scenario Done will be nice.

see in image

Upvotes: 2

Related Questions