[英]Dismiss a modal viewController with push/pop animation in iOS
介紹時:
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"];
但我不知道如何自定義解雇動畫
嘗試這樣做:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.