I have a UITableViewController with a grouped static UITableView. I am defining the cells for my static table view on the storyboard. One of the cells has a textfield in it. When this textfield is called, the keyboard pops up, however, the tableview is not automatically resizing like it normally would on a table view controller. So now the keyboard is partially covering the textfield and I can’t scroll up.
My understanding is that when you are using a UITableViewController and a tableview, the viewable area should automatically shrink when the keyboard is called. It does work as intended in other parts of my app, just not with this static table view. Does it not work with static tables? Is there something else I am missing? Is there an easy way to solve this?
Thanks
Answer
It has nothing to do with static cells. They should work.
If your controller is already a UITableViewController, check if you used the method
viewWillAppear. If you did, you have to call[super viewWillAppear:YES]to get the ‘automatic behavior’ to work.This problem turns up easily because the boilerplate code for the controllers don’t come with the
viewWillAppearmethod call and if you define it in your controller, you override it.Extra Information
Look at this link.
Apple Table View Programming Guide
The important bit