I\'ve seen posts around here that suggest that UIScrollViews
should automatically scroll if a subview UITextField
becomes the first responder; however,
There is nothing you have to do manually. It is the default behavior. There are two possibilities as to why you are not seeing the behavior
UITextField
. See below for solutionUIScrollView
somewhere in the view hierarchy between the UITextField
and the UIScrollView
that you want to auto scroll. This is less likely but can still cause problems.For #1, you want to implement something similar to Apple's recommendations for Moving Content That Is Located Under the Keyboard. Note that the code provided by Apple does not account for rotation. For improvements on their code, check out this blog post's implementation of the keyboardDidShow
method that properly translates the keyboard's frame using the window.