开发者

how to push a viewController with flip animation

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
alarmViewController = [[Alarm开发者_JS百科ViewController alloc] init];
[self.navigationController pushViewController:alarmViewController animated:YES];
[alarmViewController release];
[UIView commitAnimations];

I just want the viewcontroller flip like opening a book page,but it does not work like this.And I have a question that whether navigationController can animate this effect?


Since you are already putting the navigationController in an animation block. Mark animated:NO -

[self.navigationController pushViewController:alarmViewController animated:NO];

when we actually call pushViewController: we are setting the animated value to NO. This disables the Navigation Controller's default animation. Instead, the block of code uses the defined transition.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜