O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling the Keyboard

You have not yet finished making the edit scene work in all screen sizes and orientations. The problem is that the keyboard sometimes covers at least one of the input lines, and there is no layout that works in all orientations and screen sizes with the keyboard open.

The solution is to put the view with the fields inside a UIScrollView. When the screen is big enough to show everything—that is, when the scroll view is large enough to show all the content—it only bounce scrolls (or not, if the Bounce Vertically check box is unchecked). The user cannot accidentally move the content off the screen. But when the keyboard opens, you resize the scroll view to be above the keyboard. The content view stays the same size, so the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required