RDRStickyKeyboardView
RDRStickyKeyboardView copied to clipboard
Fixing custom contentInsets
Showing and hiding the keyboard breaks custom contentInsets for the tableView.
I haven't tested myself yet but are you sure this works? It doesn't seem to be a good idea to increment the contentInset because this will cause the contentInset to grow indefinitely when the method is called over and over again.
I understand your skepticism, but it is working. You are forgetting that I also changed the multiplier for the bottomInset
:
bottomInset *= RDRKeyboardIsFullyHidden(keyboardFrame) ? -1 : 1;
The problem with the current implementation is that you add to the contentInset
the height of the keyboard, but when it's dismissed, you don't subtract it back. You are setting something based on the size of the view, disregarding that it may have a custom contentInset
setted.
I've tried as well, and as @datwelk was saying, it will make the contentInset to grow indefinetely
Then I cannot merge this ^^. Maybe we can check scrollView's initial contentInset inside the initWithScrollView
method of RDRStickyKeyboardView
. This will however not work if the scrollView's contentInset is changed afterwards.
The project has no tests, but let me see if I can poke around more and try duplicating the issues you're mentioning.