检测iPad键盘隐藏按钮

Mom*_*omi 7 ipad

嗨有没有办法检测iPad键盘隐藏按钮?我的意思是当用户按下此按钮时:

替代文字

事情会发生!

Dar*_*ust 17

我不确定你想要完成什么,但也许这可以帮助你:注册NSNotificationCenter以接收UIKeyboardWillHideNotification和/或UIKeyboardDidHideNotification.

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(myKeyboardWillHideHandler:)
                                             name:UIKeyboardWillHideNotification
                                           object:nil];

...

- (void) myKeyboardWillHideHandler:(NSNotification *)notification {
    NSLog(@"Keyboard wants to hide. What a coward.");
}
Run Code Online (Sandbox Code Playgroud)