I am looking for a way to show my own input view (a UITableView) to enter certain keywords in a UITextView faster than typing them, and also be able to type into this text view the normal way. My solution has a button that causes the keyboard to disappear, revealing the table view underneath it.
Problem is I can't figure out how to make the k开发者_如何学编程eyboard go away without resigning first responder, and losing the cursor. Has anyone accomplished this before?
Thanks for any help.
Nope
As far as I know there is no way to do this, and I have searched extensively. Very frustrating that selection and the cursor are restricted to the keyboard.
I could be wrong though. Votes? Suggestions?
You can call becomeFirstResponder
on some other thing that you choose. It could be a UIViewController
or a UIView
. I had a similar problem before, I needed to make my keyboard go away when I was pushing my view controller back to its caller, without knowing which textfield was the first responder. Then, on viewWillAppear of my view controller which I was returning back, I called [self becomeFirstResponder]
and the keyboard of the pushed view was gone. Because this made whichever text field was it loose being the first responder.
精彩评论