[英]Height from keyboard to navigationbar
您可以通过更改UITableView底部约束来实现。
将您的UITableView底部固定到superView。然后注册UIKeyboardWillShowNotification
/ UIKeyboardWillHideNotification
并从NSNotification对象键盘框架获取并更改底部约束常量,如下所示:
- (void)keyboardWillShow:(NSNotification *)notification {
CGRect keyboardRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
self.tableViewBottomConstraint.constant = CGRectGetHeight(keyboardRect);
[self.view layoutIfNeeded];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.