[iOS]如何动态获取键盘的高度

// 给键盘添加监听事件

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myKeyBoardAction:) name:UIKeyboardDidShowNotification object:nil];


NSDictionary *dic = [notif userInfo];

    NSValue *value = [dic objectForKey:UIKeyboardFrameBeginUserInfoKey];

    CGSize size = [value CGRectValue].size;


你可能感兴趣的:(键盘)