0

提示する場合:

CATransition *animation=[CATransition animation];
animation.delegate=self;
animation.duration=0.3;
animation.type=kCATransitionMoveIn;
animation.subtype=kCATransitionFromRight;

UIViewController13 *vc = [[UIViewController13 alloc] init];
[self presentViewController:vc animated:NO completion:nil];
[vc.view.layer addAnimation:animation forKey:@"animation"];

しかし、閉じるアニメーションをカスタマイズする方法がわかりません

4

1 に答える 1

-1

それをやってみてください:

CATransition *animation=[CATransition animation];
animation.delegate=self;
animation.duration=0.3;
animation.type=kCATransitionMoveIn;
animation.subtype=kCATransitionFromRight;

UIViewController13 *vc = [[UIViewController13 alloc] init];

[self presentViewController:vc animated:NO completion:nil];
[self.view insertSubview:vc.view atIndex:0];  //line we add
[self.view.layer addAnimation:animation forKey:@"animation"]; //we edit
于 2013-08-19T09:05:09.170 に答える