Baub
Baub

Reputation: 5054

iPhone Keyboard Adjust In View

I've been searching, but haven't quite found a complete answer, and the Apple docs aren't much help.

I have an application with a UIView that has a lot of text fields on it, ranging from the top of the view to the bottom. When the user clicks the first UITextField the keyboard pops up. The keyboard has three buttons above it, previous, next, and done on a toolbar InputAccessoryView.

Basically, let's say there are 6 UITextField boxes that space from the top of the view to the bottom. When the user gets past the third text field, the keyboard blocks the bottom three. How do I have the view adjust up when putting text in the bottom three text fields?

Upvotes: 1

Views: 281

Answers (1)

Luke
Luke

Reputation: 11476

You need to place your textfields into a UIScrollView, and either translate the view above the keyboard when it is active and away when it is down, or another solution such as always having the keyboard up on that page, which'll save you the setFrame calls on your UIView/UIScrollView depending on what the keyboard is doing.

This will further help:

How to adjust the view position when the keyboard opens in iPhone?

Upvotes: 1

Related Questions