diff --git a/RDRStickyKeyboardView/RDRStickyKeyboardView.m b/RDRStickyKeyboardView/RDRStickyKeyboardView.m index 0f18431..dc86963 100644 --- a/RDRStickyKeyboardView/RDRStickyKeyboardView.m +++ b/RDRStickyKeyboardView/RDRStickyKeyboardView.m @@ -853,14 +853,14 @@ - (void)_scrollViewAdaptInsetsToKeyboardFrame:(CGRect)keyboardFrame // If the keyboard is not hidden, set the content inset's bottom // to the height of the area occupied by the keyboard itself. CGFloat bottomInset = keyboardHeight - inputViewHeight; - bottomInset *= RDRKeyboardIsFullyHidden(keyboardFrame) ? 0 : 1; + bottomInset *= RDRKeyboardIsFullyHidden(keyboardFrame) ? -1 : 1; UIEdgeInsets contentInset = self.scrollView.contentInset; - contentInset.bottom = bottomInset; + contentInset.bottom += bottomInset; self.scrollView.contentInset = contentInset; UIEdgeInsets scrollIndicatorInsets = self.scrollView.scrollIndicatorInsets; - scrollIndicatorInsets.bottom = bottomInset; + scrollIndicatorInsets.bottom += bottomInset; self.scrollView.scrollIndicatorInsets = scrollIndicatorInsets; }