Skip to content

Commit 2627267

Browse files
committed
Merge pull request #106 from aleufms/master
Fixed the calculation of content Inset when using the method insertRowAtIndexPath: when keyboard is visible
2 parents e54873f + faa39ca commit 2627267

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ - (UIEdgeInsets)TPKeyboardAvoiding_contentInsetForKeyboard {
227227
TPKeyboardAvoidingState *state = self.keyboardAvoidingState;
228228
UIEdgeInsets newInset = self.contentInset;
229229
CGRect keyboardRect = state.keyboardRect;
230-
newInset.bottom = keyboardRect.size.height - (CGRectGetMaxY(keyboardRect) - CGRectGetMaxY(self.bounds));
230+
newInset.bottom = keyboardRect.size.height - MAX((CGRectGetMaxY(keyboardRect) - CGRectGetMaxY(self.bounds)), 0);
231231
return newInset;
232232
}
233233

0 commit comments

Comments
 (0)