setText时不能使用Frame.origin

我正在使用下一个代码淡出并向上滚动我的文本字段,但我注意到当我使用类似[textField setText:@"something"];[textField resignFirstResponder]; 我失去了向上滚动。 任何人都要小心解释为什么我会得到这种行为和一个posibble解决方法。

 [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationCurveEaseInOut animations:^ { CGRect Frame = textField.frame; Frame.origin.y=100; textField.frame=Frame; textField.alpha = 0.0; } completion:^(BOOL finished) { textField.hidden = YES; }]; [textField resignFirstResponder]; } 

你应该把[textField resignFirstResponder]; 进入完成块。