I'm using a UITextView and want to keep the normal usage of Return key, i.e. to insert a new line. But how do I dismiss the keyboard when I can't use the Return key for that?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
How the user triggers it is a design decision: another button, a swipe gesture?
When it's triggered, call:
A lot of people add a UIToolbar with a Done button on it above the keyboard. This is how the Safari app does it as well and in my opinion it is the best way to handle this situation. See a pic here.
To dismiss the keyboard, you just have to do
[textField resignFirstResponder];.
Here is an okay example of how to add the UIToolbar when the keyboard shows/hides.
Make sure you declare support for the UITextViewDelegate protocol.
Enjoy Buddy with this code....
You could just use a background tap to hide the keyboard.
A good way to Dismiss keyboard.