开发者

how to push a viewController with flip animation

开发者 https://www.devze.com 2023-04-02 04:34 出处:网络
[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[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

精彩评论

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