diff --git a/Blog/EditorViewController.m b/Blog/EditorViewController.m index e50edef..da7836b 100644 --- a/Blog/EditorViewController.m +++ b/Blog/EditorViewController.m @@ -240,6 +240,9 @@ UIEdgeInsets inset = self.textView.contentInset; inset.bottom = bottomInset; self.textView.contentInset = inset; + inset = self.textView.scrollIndicatorInsets; + inset.bottom = bottomInset; + self.textView.scrollIndicatorInsets = inset; // TODO: put the selection in the middle somehow ... can we get the point/rect for the selection? [self.textView scrollRangeToVisible:self.textView.selectedRange]; } diff --git a/Blog/PostsViewController.m b/Blog/PostsViewController.m index d3e4c7d..767ef3b 100644 --- a/Blog/PostsViewController.m +++ b/Blog/PostsViewController.m @@ -365,15 +365,20 @@ static const NSUInteger SectionPublished = 1; - (void)keyboardWillShow:(NSNotification *)note { NSValue *keyboardFrame = note.userInfo[UIKeyboardFrameEndUserInfoKey]; CGFloat keyboardHeight = keyboardFrame.CGRectValue.size.height; - UIEdgeInsets inset = self.tableView.contentInset; - inset.bottom = keyboardHeight; - self.tableView.contentInset = inset; + [self adjustTableViewBottomInsets:keyboardHeight]; } - (void)keyboardWillHide:(NSNotification *)note { + [self adjustTableViewBottomInsets:0]; +} + +- (void)adjustTableViewBottomInsets:(CGFloat)bottom { UIEdgeInsets inset = self.tableView.contentInset; - inset.bottom = 0; + inset.bottom = bottom; self.tableView.contentInset = inset; + inset = self.tableView.scrollIndicatorInsets; + inset.bottom = bottom; + self.tableView.scrollIndicatorInsets = inset; } #pragma mark - Blog notificitons