views:

695

answers:

2

I am using UITextField to receive user inputs. However, since my textfields are towards the middle/bottom of the nib, it gets hidden when the keyboard pops up. Is there any way sort of slide it along with the keyboard so that it's on the top of the keyboard during selection? Also, since I am also using the numberpad, is there an easy way to include a done button somewhere?

Thanks for the help.

A: 

This situation kind of sucks on the iPhone. What you are supposed to do is either design your interface in such a way that the fields are visible when the keyboard appears, or shift the field up when the keyboard appears. (And back down when you are done)

I suggest to look at some Apple apps like Contacts or Settings to see how they are dealing with this.

Also, I'm sure the iPhone HIG has something to say about it.

St3fan
+2  A: 

To scroll when the keyboard appears, I like this tutorial from Cocoa With Love.

To dismiss the number keypad, you can put a custom "Done" button on the keypad or make an invisible button over the rest of the screen. I have done the latter with code, but this tutorial uses Interface Builder.

gerry3