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

 

posted @ 2013-11-07 10:46  HA-LOU  阅读(258)  评论(0编辑  收藏  举报