I’m working on an iPhone app and in the iPhone app the user is typing in an UITextView.
I was wondering how I could add the done key on the keyboard instead of having the normal return key and when you click on that key the keyboard closes.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no
-textViewShouldReturn:method in theUITextViewDelegateprotocol. If you want the return (done) key to dismiss the keyboard, it’s probably best to use a UITextField instead,UITextViewis intended for editing multiple lines of text (so you need a way to enter a linebreak).If you really want to dismiss the keyboard when hitting the return key in a
UITextView, you could probably do something like this: