tags:

views:

489

answers:

0

I have a UITextField set up in a UITableViewCell, for a control mimicking that in Apple's own Contacts app, when you go to edit a field. This is all mostly working fine, except for a little UI bug. The UITableView is part of a UIViewController created and loaded from a XIB, but the text field is being created programatically (and becoming first responder) in tableView:cellForRowAtIndexPath:, so that it can be added to the cell. This results in a slight keyboard lag, where the view controller is pushed onto the stack, with the keyboard coming soon after. The Contacts app, however, pushes it all as one.

How can I correct this lag? I've tried moving the text field creation and first respondering to viewDidLoad, and this didn't help. I even tried creating a "layoutSubviews" and calling it from outside the view controller, before it was pushed to the stack. Unfortunately, it doesn't seem as though the text field actually becomes the first responder until it is part of the cell -- well after the view has been pushed.

Any help would be greatly appreciated.