【发布时间】:2011-06-23 07:44:06
【问题描述】:
我有一个按钮,按下它会推动视图控制器,但是我使用的是自定义动画,所以 pushViewController: childController animated: 设置为 NO。我想做的是在我的- (void)viewWillAppear:(BOOL)animatedmethod 中检测这个自定义动画并写一个这样的 if 语句;
- (void)viewWillAppear:(BOOL)animated {
if (customAnimation occured) {//Do this}
else {//Do this}
}
这是我的按钮推动视图控制器的方法。
- (void)nextPressed:(id)sender {
childController = [[CategoryOneDetailController alloc] initWithNibName:xibDownName bundle:nil];
[UIView beginAnimations: @"Showinfo"context: nil];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController: childController animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
[childController release];
}
任何帮助将不胜感激,谢谢,Sami。
【问题讨论】:
标签: objective-c if-statement animated viewwillappear commitanimations