方法 textViewDidEndEditing
当您关闭 iPad 上的键盘时,不会调用按钮右上角的按钮。但是,我希望调用该方法,以便我基本上可以访问书面文本。
有什么建议吗?
最佳答案
观察UIKeyboardDidHideNotification
:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardDidHide:)
name:UIKeyboardDidHideNotification
object:nil];
- (void)keyboardDidHide:(NSNotification *)note {
// Whatever you want
}
不要忘记在 dealloc
中调用 removeObserver:
:
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
关于ios - 在 iPad 上不调用 UITextView didEndEditing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7517599/