如何在基于导航的应用程序中更改Push和Pop动画我有一个基于导航的应用程序,我想改变动画的推送和流行动画。我该怎么做?这个问题有很多答案,现在已经有很长一段时间了,我重新选择了我认为最相关的答案。如果有人不这么认为,请在评论中告诉我。
3 回答
守候你守候我
TA贡献1802条经验 获得超10个赞
CATransition* transition = [CATransition animation]; transition.duration = 0.5; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionFade; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade //transition.subtype = kCATransitionFromTop; //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom[self.navigationController.view.layer a ddAnimation:transition forKey:nil];[[self navigationController] popViewControllerAnimated:NO];
let transition = CATransition()transition.duration = 0.5transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)transition.type = kCATransitionFadeself.navigationController?.view.layer.add(transition, for Key: nil)_ = self.navigationController?.popToRootViewController(animated: false)
冉冉说
TA贡献1877条经验 获得超1个赞
MainView *nextView=[[MainView alloc] init];[UIView beginAnimations:nil context:NULL];[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.75];[self.navigationController pushViewController:nextView animated:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];[UIView commitAnimations]; [nextView release];
[UIView beginAnimations:nil context:NULL];[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.75];[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView: self.navigationController.view cache:NO];[UIView commitAnimations];[UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelay:0.375];[self.navigationController popViewControllerAnimated:NO];[UIView commitAnimations];
MainView *nextView = [[MainView alloc] init];[UIView animateWithDuration:0.75 animations:^{ [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [self.navigationController pushViewController:nextView animated:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO]; }];
[UIView animateWithDuration:0.75 animations:^{ [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO]; }];[self.navigationController popViewControllerAnimated:NO];
- 3 回答
- 0 关注
- 679 浏览
添加回答
举报
0/150
提交
取消