tags:

views:

19

answers:

2

In an iPhone app, how do I keep the software keyboard from obscuring buttons, or UITextView fields in a View?

I've got the following layout:

View -\
     UITextView
     UIButton

... but, the keyboard obscures the button at the bottom when I'm typing in the UITextView. I tried using the following:

View -\
     UIScrollView -\
         UITextView
         UIButton

... but, the window does not scroll as expected, so the user has no way of clicking the button.

How is this normally handled?

Note: I do not want to scroll down automatically to make the button visible. I just want the user to be able to scroll down when they are done typing.

A: 

You manually set the coordinates of the controls when the keyboard appears and disappears. Or you use a UIScrollView and manually set the scroll offset.

Rengers
I don't want to automatically scroll it. I want the user to be able to scroll the view to see the button when they are done typing. Like the "Compose Mail" dialog in the Mail app.
synic
A: 

You should tell the UIScrollView scrollTo... and you must figure out how far to scroll based on what input field was selected that caused the keyboard to appear.

jamone
Again, I don't want it to scroll automatically. I want the user to be able to scroll down to see the button whenever they want.
synic