I have a UITextField
inside a UIView
which is used as the tableHeaderView of a UITableView
.
When I call resignFirstResponder
for the textField
in order to dismiss the keyboard, the whole tableHeaderView vanishes. Same happens when I try to reload the data of the tableview while the keyboard is up.
Any ideas why?
EDIT: Sample code
UITableViewCell *header = [self.tableView dequeueReusableCellWithIdentifier:@"mapViewCell"];
UITextField *searchField = [header viewWithTag:6];
searchField.delegate = self;
self.tableView.tableHeaderView = header;
and in a delegate method for textfield:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
[searchField resignFirstResponder];
return YES;
}
Keyboard is dismissed but the whole tableHeaderView
goes away (turns into white)