I have implemented some code that will automatically set a UIScrollView’s ContentOffset when the keyboard is displayed and will cover the currently active control.
For example, if the user taps a UITextView at the bottom of the form, the UIScrollView will be scrolled up so that the entire control is visible.
This all works nicely until the user taps into another UITextView. At this point, the UIScrollView feels that it is necessary to scroll back to the top of the view, which is exceedingly annoying.
I tried what I though was an obvious answer: ShouldScrollToTop. However, that is a somewhat misleading name because it only applies when the the user taps the status bar.
If I set ScrollEnabled to false after the keyboard is displayed, the user can’t scroll through the form, which makes it very difficult to work with the form.
I have also tried setting the ContentSize to include both the form size and the keyboard, but that didn’t do anything.
All I want to do is prevent the scroll view from automatically scrolling back to the top when another field is tapped. It really should not be this difficult Apple.
Of course, right after I posted the question, I scoured the scroll view properties in Interface Builder and started turning off everything that I didn’t think was absolutely necessary.
As soon as I turned off Paging Enabled, the scroll view stopped automatically scrolling to the top.
I decided to answer this and leave the question in case someone else runs into the same problem because I couldn’t find any solutions anywhere else.