From 4cd9ba4e73067ae9d0b997bc82602d32c7a41c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Caetano?= Date: Tue, 22 Jul 2014 21:45:39 -0300 Subject: [PATCH] Fixing custom contentInsets --- RDRStickyKeyboardView/RDRStickyKeyboardView.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }