如何在 iPad 上收听浮动键盘显示和隐藏?UIKeyboardWillShowNotification
或者UIKeyboardWillHideNotification
不会被召回。主要代码如下:
- (void)viewDidLoad() {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide) name:UIKeyboardWillHideNotification object:nil];
}
- (void)keyboardWillShow:(NSNotification *)note {
// NOT called back
}
- (void)keyboardWillHide {
// NOT called back
}