网上问答整理:
出现原因:
因为键盘收起是有动画的,而你在键盘收起的动画开始的时候就pop了,键盘的动画没有执行完当然要在下一个vc里继续执行。所以你要等键盘完全收起之后再pop或者push。直接dispatch_after个0.25秒再执行pop或者push。至于为什么是0.25秒,因为系统键盘收起的duration就是0.25秒
解决方法:
(1) 0.25秒后再pop
[self performSelector:@selector(xxx) withObject:nil afterDelay:0.25];
(2)代理方法中处理
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{ [[alertView textFieldAtIndex:buttonIndex]resignFirstResponder]; }