每当我单击文本字段时,键盘会弹出并部分阻止图像中看到的其他文本字段,我该如何管理它?我希望每当右下角的最后一个文本字段被填充时,第二行应该是向上且可见的!顺便说一下,在 ViewController 的顶部滚动视图。
-(void)ViewDidLoad
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];
}
- (void)keyboardDidShow:(NSNotification *)notification
{
[self.view setFrame:CGRectMake(0,-260,1030,768)];
}
-(void)keyboardDidHide:(NSNotification *)notification
{
[self.view setFrame:CGRectMake(0,0,1030,768)];
}