2.解决uitableview中键盘遮挡问题
/*
* 键盘要显示的时候
*/
- (void)showKeyboardWithRect:(CGRect)keyboardRect
withDuration:(CGFloat)animationDuration{
CGSize kbSize = keyboardRect.size;
UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0);
_baseTableView.contentInset = contentInsets;
_baseTableView.scrollIndicatorInsets = contentInsets;
// If active text field is hidden by keyboard, scroll it so it's visible
// Your app might not need or want this behavior.
CGRect aRect = self.view.frame;
aRect.size.height -= kbSize.height;
if (!CGRectContainsPoint(aRect, _activeCell.frame.origin) ) {
[_baseTableView scrollRectToVisible:_activeCell.frame animated:YES];
}
}
/*
* 键盘要消失的时候
*/
- (void)hiddenKeyboardWithRect:(CGRect)keyboardRect
withDuration:(CGFloat)animationDuration{
_baseTableView.contentInset = UIEdgeInsetsZero;
_baseTableView.scrollIndicatorInsets = UIEdgeInsetsZero;
}
总结
以上就是这篇文章的全部内容了,希望本文的内容对各位Android开发者们能有所帮助,如果有疑问大家可以留言交流。
注:相关教程知识阅读请移步到IOS开发频道。










