tableView resize problem when pushing another view while keyboard is showing
- by Rollin_s
I have a tableview controller under a navigation controller. Some of my table cells contain text fields, so when I tap on them, a keyboard will show up and automatically resize (shrink) the bounds of my tableview. The bounds is then restored when the keyboard is dismissed programmatically by calling resignFirstResponder on my text field.
Some of my cells would push a new view controller into the view stack when tapped on, so I first resign my current textfield before pushing the view controller:
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (currentEditingTextField != nil) {
[currentEditingTextField resignFirstResponder];
currentEditingTextField = nil;
}
return indexPath;
}
The problem is when I navigate back to my table view, the bounds of the tableview is sized as if the keyboard is still there. I know this because the scroll indicator only reaches right above where the keyboard was and there is empty view space below the table view.
Anybody experienced this and know of a solution? Thanks