presentModalViewController完成滑动后如何制作动画?
|
我显示的登录屏幕有错误,例如:
_loginViewController.error = error;
[_navigationController presentModalController: _loginViewController
animated: YES];
在LoginViewController中,我想将错误消息滑动到屏幕上,如下所示:
- (void)showErrorAnimated: (BOOL)animated;
{
_errorLabel.text = [_error localizedDescription];
[UIView beginAnimations: @\"showError\"
context: NULL];
CGRect frame = [_errorView frame];
frame.origin.y = 0; // starts at -frame.size.height
[_errorView setFrame: frame];
[UIView commitAnimations];
}
但是我不知道如何调用它来匹配视图控制器完成其滑动到屏幕顶部(由presentModalController:animated:
开始)的时间。
我怎样才能使这个时间发挥作用?
没有找到相关结果
已邀请:
1 个回复
撕吠
方法,该方法将在显示视图时调用。 http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW17 请注意
,因为只要显示视图便会调用它。这意味着,如果您的控制器提供一个模态控制器,然后将其关闭,则将再次调用
和
方法。