让push跳转动画像modal跳转动画那样效果(从下往上推上来)
作者:
程序员不务正业 | 来源:发表于
2017-08-24 21:31 被阅读14次- (void)push
{
TestViewController *vc = [[TestViewController alloc] init];
vc.view.backgroundColor = [UIColor redColor];
CATransition* transition = [CATransition animation];
transition.duration = 0.4f;
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromTop;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:vc animated:NO];
}
- (void)pop
{
CATransition* transition = [CATransition animation];
transition.duration = 0.4f;
transition.type = kCATransitionReveal;
transition.subtype = kCATransitionFromBottom;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popViewControllerAnimated:NO];
}
本文标题:让push跳转动画像modal跳转动画那样效果(从下往上推上来)
本文链接:https://www.haomeiwen.com/subject/zogphxtx.html
网友评论