Skip to content

Commit

Permalink
Fix iPad scrolling. Fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Oct 1, 2012
1 parent 7ae19b8 commit 32a76bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Classes/CDIManagedTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,15 @@ - (void)editRow:(UIGestureRecognizer *)editingGestureRecognizer {
- (void)updateTableViewOffsets {
CGFloat offset = self.tableView.contentOffset.y;
CGFloat top = fminf(0.0f, offset);
CGFloat bottom = fmaxf(_keyboardRect.origin.x, _keyboardRect.origin.y);

CGFloat bottom = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? self.keyboardRect.size.height : 0.0f;
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(top, 0.0f, bottom, 0.0f);
self.pullToRefreshView.defaultContentInset = UIEdgeInsetsMake(0.0f, 0.0f, bottom, 0.0f);
}


- (void)keyboardDidShow:(NSNotification *)notification {
NSDictionary *userInfo = [notification userInfo];
_keyboardRect = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
_keyboardRect = [self.view convertRect:[[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue] fromView:nil];

_allowScrolling = YES;
CGFloat duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
Expand Down

0 comments on commit 32a76bd

Please sign in to comment.