监听键盘高度变化

 [[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);

    }

}

原文地址:https://www.cnblogs.com/leevaboo/p/3127141.html