如何检测国际键盘的隐藏事件?
以下相关链接没有帮助。 检测国际键盘的出现和消失 更多信息: 这是我设置通知的方法,包括
UIKeyboardDidHideNotification
似乎没有触发。以下相关链接没有帮助。 检测国际键盘的出现和消失 更多信息: 这是我设置通知的方法,包括
UIKeyboardDidHideNotification
和 UIKeyboardDidShowNotification
。[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
-(void)keyboardDidShow:(NSNotification*)notification {
NSLog(@"keyboardDidShow");
}
-(void)keyboardDidHide:(NSNotification*)notification {
NSLog(@"keyboardDidHide");
}
keyboardDidShow
触发两次。第一次是标准键盘弹出时。第二次是国际键盘弹出时。
keyboardDidHide
当我隐藏国际键盘时不会被触发。但当标准键盘被隐藏时,它会被触发。
我有什么遗漏吗?
UIKeyboardWillHideNotification
一样吗?你是怎么设置你的通知的? - KjulyUIKeyboardWillHideNotification
而不是UIKeyboardDidHideNotification
。 - KjulyUIKeyboardDidChangeFrameNotification
在键盘框架变化时调整您的用户界面。 - Sergiy Salyuk