IOS Keyboard change about

--注册监听函数
  [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWasShown:)
                                                 name:UIKeyboardDidChangeFrameNotification
                                               object:nil];
--监听消息
- (void)keyboardWasShown:(NSNotification *)notification
{
    // Get the size of the keyboard.
    
    CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; DebugLog(@"keyboardSize:%@",NSStringFromCGSize(keyboardSize));
    //your other code here..........
}

ref developer.apple.com

原文地址:https://www.cnblogs.com/halou/p/3412007.html