tags:

views:

146

answers:

2

In forms that are longer than 50% of the screen area, inputs will appear underneath the keyboard. I want to adjust the view to keep the selected input always visible when the keyboard shows and reset its position when the keyboard disappears.

Any ideas? Thanks.

+1  A: 

If you're in a UIScrollView, you can use the -scrollRectToVisible:animated: method to move to a particular portion of the view.

If you're in a UITableView, you can use the -scrollToRowAtIndexPath:atScrollPosition:animated: method to scroll to a particular row, or - scrollToNearestSelectedRowAtScrollPosition:animated:.

Jeff Kelley
+3  A: 

The section Managing the Keyboard in the iPhone Application Programming Guide discusses how to receive notifications of keyboard display/undisplay, as well as how to keep your content visible (including sample code).

Sixten Otto