I can't believe that this question hasn't been asked yet, but I have been unable to find it so that is my assumption.
I have created custom UITableViewCel
l subclasses using Interface Builder. These each contain a UILabel
and a UITextField
and are used for our login screen.
On the first UITextField
, I want the Keyboard Key to say Next
. However, on the second UITextField
, I want it to say "Done."
How do I programmatically change the value of the Return Key
on the keyboard? I cannot use Interface Builder
, since that would make both keys appear as Done
.
Thanks!
An object that displays an editable text area in your interface.
Tap “123” key in the bottom-left corner of the keyboard. 2. The Return key is located in the bottom-right corner, next to the space bar.
For the first UITextField
, Read THIS tutorial on how to create a button on a Keyboard. You can learn the logic from there and use a Next
button instead of Done
button.
//if you just want to make it appear NEXT// textField.returnKeyType = UIReturnKeyNext;
And for the second UITextField
, use...
// for DONE // textField.returnKeyType = UIReturnKeyDone;
You can in general create and rename the button to anything, and make sure you give the right IBAction
on the event that that button is pressed. In case you do create your own custom button, look at the tutorial above to learn about placing it in the right coordinates and stuff.
you have to invoke [textView reloadInputViews];
after setting the return key type to update the keyboard return key appearance immediately.
DO IT AS FLLOW:
textView.returnKeyType = UIReturnKeyDone; [textView reloadInputViews];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With