模拟导航pop动画
CATransition* animation = [CATransition animation];
animation.type = kCATransitionPush; //改变视图控制器出现的方式
animation.subtype = kCATransitionFromLeft; //出现的位置
[animation setDuration:0.35f];//动画时间
[animation setFillMode:kCAFillModeForwards];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
[self.tabBarController.view.layer addAnimation:animation forKey:kCATransition];
self.tabBarController.selectedIndex = 0;
[self.navigationController popToRootViewControllerAnimated:NO];
网友评论