I managed to get everything to work fine with a small workaround. I just did this:
// in a method that gets repeatedly called as the pan gesture recognizer changes if([tableView contentOffset].y > 0) { UIEdgeInsets insets = [tableView contentInsets]; inset.bottom = currentKeyboardHeight; [tableView setContentInset:inset]; }
so that the inserts do not change if the contentOffset was at the very top or scrolling from the top. If the table scrolls and drags a little, it will change the insert until it hits the top, and then it stops changing, so that a strange flicker does not occur.
Edit: Figured out the root cause and thought I was updating this, and not just leaving a workaround. What I did was mixing CGAffineTransformMakeTranslation
in the middle of my frame calculations, which is a big no-no problem according to Apple's documentation. If the transform
property is not CGAffineTransformIdentity
, then the frame
becomes undefined, and this caused a very strange behavior if I scroll through the table view and at the same time change its insert content.
source share