Skip to content

Commit d418b6f

Browse files
committed
Animated change of contentOffset for case with changing keyboard height
1 parent 2c3cc0f commit d418b6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ - (void)TPKeyboardAvoiding_keyboardWillShow:(NSNotification*)notification {
8484

8585
self.contentInset = [self TPKeyboardAvoiding_contentInsetForKeyboard];
8686

87+
self.scrollIndicatorInsets = self.contentInset;
88+
[self layoutIfNeeded];
8789
CGFloat viewableHeight = self.bounds.size.height - self.contentInset.top - self.contentInset.bottom;
8890
[self setContentOffset:CGPointMake(self.contentOffset.x,
8991
[self TPKeyboardAvoiding_idealOffsetForView:firstResponder
9092
withViewingAreaHeight:viewableHeight])
91-
animated:NO];
93+
animated:YES];
9294

93-
self.scrollIndicatorInsets = self.contentInset;
94-
[self layoutIfNeeded];
9595

9696
[UIView commitAnimations];
9797
}

0 commit comments

Comments
 (0)