diff --git a/TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m b/TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m index c0268739..11a544ac 100644 --- a/TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m +++ b/TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m @@ -203,14 +203,26 @@ - (void)TPKeyboardAvoiding_assignTextDelegateForViewsBeneathView:(UIView*)view { } -(CGSize)TPKeyboardAvoiding_calculatedContentSizeFromSubviewFrames { + + BOOL wasShowingVerticalScrollIndicator = self.showsVerticalScrollIndicator; + BOOL wasShowingHorizontalScrollIndicator = self.showsHorizontalScrollIndicator; + + self.showsVerticalScrollIndicator = NO; + self.showsHorizontalScrollIndicator = NO; + CGRect rect = CGRectZero; for ( UIView *view in self.subviews ) { rect = CGRectUnion(rect, view.frame); } rect.size.height += kCalculatedContentPadding; + + self.showsVerticalScrollIndicator = wasShowingVerticalScrollIndicator; + self.showsHorizontalScrollIndicator = wasShowingHorizontalScrollIndicator; + return rect.size; } + - (UIEdgeInsets)TPKeyboardAvoiding_contentInsetForKeyboard { TPKeyboardAvoidingState *state = self.keyboardAvoidingState; UIEdgeInsets newInset = self.contentInset;