Skip to content

Commit

Permalink
Merge pull request #83 from pseudostudios/master
Browse files Browse the repository at this point in the history
Fixed issue #76.  In TPKeyboardAvoiding_calculatedContentSizeFromSubview...
  • Loading branch information
michaeltyson committed Jan 30, 2014
2 parents 1cb7fdb + 0e3612f commit 9cab052
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9cab052

Please sign in to comment.