在present加上这个转场动画,取消掉原来的转场动画

  CATransition *animation = [CATransitionanimation];

    animation.duration = 0.35;

    animation.timingFunction = UIViewAnimationCurveEaseInOut;

    animation.type = kCATransitionPush;

  animation.subtype = kCATransitionFromRight;

    [self.view.window.layeraddAnimation:animation forKey:nil];

    [self presentViewController:setVC animated:NOcompletion:nil];

在dissmiss加上这个转场动画,取消掉原来的动画效果

      CATransition *animation = [CATransition animation];

 animation.duration = 0.35;

 animation.timingFunction = UIViewAnimationCurveEaseInOut;

 animation.type = kCATransitionPush;

 animation.subtype = kCATransitionFromLeft;

   [self.view.window.layer addAnimation:animation forKey:nil];

       [selfdismissViewControllerAnimated:NOcompletion:nil];

然后就和NavCtl的push效果和back效果几乎一致。

相关文章:

  • 2021-08-02
  • 2021-05-30
  • 2021-12-29
  • 2021-12-02
  • 2021-11-18
  • 2022-12-23
  • 2021-06-11
猜你喜欢
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案