我在页面中制作一个可移动的视图。当键盘显示并向下移动到原始位置时,此视图应向上移动20px(我使用方法[uiview animatewithduration:animation]并更改移动视图的框架这是正常运行直到我选择自动布局。(仍然存在动画,但是移动视图不改变它的框架。)任何人都可以告诉我如何解决这个问题?
-(void)keyboardWillShown:(NSNotificationCenter *)notification
{
[UIView animateWithDuration:0.2 animations:^{
__moveView.frame = CGRectMake(0, 0, __moveView.frame.size.width, __moveView.frame.size.height);
btn_question.hidden = YES;
} ];
}
-(void)keyboardWillHidden:(NSNotificationCenter *)notification
{
[UIView animateWithDuration:0.2 animations:^{
__moveView.frame = CGRectMake(0, 77, 320, 407);
}];
btn_question.hidden = NO;
}