我有一个视图控制器,我有一个表格视图,在表格视图中,当我点击文本字段键盘时,每一行都有文本字段,键盘出现并隐藏表格视图,然后看不到编辑,我该如何解决这个问题问题?我放置了修复视图控制器对齐的观察者,但它在这里不起作用是代码..
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
return YES;
}
-(void)keyboardWillShow {
// Animate the current view out of the way
[UIView animateWithDuration:0.3f animations:^ {
self.viewFrame = CGRectMake(0, -160, 320, 480);
}];
}