Keyboard not dismissed
I am developing a messaging application that have SMS.app-like UI. Conversation screen has text input field at the bottom which is moved up with keyboard. Tapping on conversation area dismisses keyboard by calling resignFirstResponder method on UITextView that we use.
This usually works fine, but users report a weird bug which I can't reproduce and fix. People say that sometimes onscreen keyboard doesn't go away when they tap on conversation area, though text input field loses input focus. Once the view enters that abnormal state users are able to type with keyboard, but text that is being entered is not visible anywhere. This bug happens in one of conversation views and since then no one text input field in other views doesn't work as expected. The only way to stop this weird behavior is killing application from multitasking bar.
Even more weird thing is that keyboard stays visible while navigating between view controllers in UINavigationController. I noticed two things:
Anyone else experiencing same problems. Any ideas on what may cause this bug?
If the text field has a delegate, and the delegate is returning NO for textFieldShouldEndEditing
, then resignFirstResponder
will fail. I don't know if that's the issue you are seeing, but something to check.
将textfield / textview委托设置为fileowner。
链接地址: http://www.djcxy.com/p/44288.html下一篇: 键盘没有被解雇