监听键盘高度变化

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasChange:) name:UIKeyboardDidChangeFrameNotification object:nil];

- (void)keyboardWasChange:(NSNotification *)aNotification {

   NSDictionary *info = [aNotification userInfo];

    CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;    

    if (kbSize.height == 216) {

        //英文键盘的高度

        _columnBack.frame = CGRectMake(0, 198 + heightAdded, 320, 44);

    }

    else if(kbSize.height == 252){

     //中文键盘的高度

              _columnBack.frame = CGRectMake(0, 165 + heightAdded, 320, 44);

    }

}

posted @ 2013-06-08 17:18  leevaboo  Views(259)  Comments(0Edit  收藏  举报