tableView resize problem when pushing another view while keyboard is showing
Posted
by Rollin_s
on Stack Overflow
See other posts from Stack Overflow
or by Rollin_s
Published on 2010-01-18T22:12:15Z
Indexed on
2010/04/24
14:53 UTC
Read the original article
Hit count: 217
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
© Stack Overflow or respective owner