I have a UIViewController with a UITableView. The first row of the UITableView is a cell that has a UITextField in it. I'd like to improve my UI a little by showing the keyboard when the view is shown. I have tried putting the BecomeFirstResponder method in various events but have yet to get this to work.
Can someone please provide tips on how to present the keyboard when the view is presented via the PushViewController?
Thank you.
in your viewdidload, put this:
I am not sure at all is this works :S
please tell if it does/don't :)
You can try setting up a notification for when your cell view is loaded or appeared. Then you can call the becomeFirstResponder on the field after the notification is fired off.
First of all, always use a UITableViewController derived class instead of a UIViewController when working with a UITableView. This will help you to resize the view, and makes sure fields are visible when the keyboard is shown.
You can show the keyboard for the first field by calling BecomeFirstResponder in the ViewDidAppear event. Example:
In your subclass of UITableViewSource or UITableViewDelegate try overriding WillDisplay method, like this:
It should work (note that you probably wish to add some code to make sure this is executed only once)