iOS 模拟导航pop动画

2020-12-16  本文已影响0人  writeSpace

模拟导航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];

上一篇 下一篇

猜你喜欢

热点阅读