Push ViewController from Right To Left with UINavigationController

后端 未结 11 1773
名媛妹妹
名媛妹妹 2020-12-02 11:27

As everyone know the UINavigationController push a ViewController from Left To Right, is there a way to push the View from Right To Left? like the animation for the back but

11条回答
  •  旧巷少年郎
    2020-12-02 12:00

    This code is working fine. Please try

    CATransition *transition = [CATransition animation];
    transition.duration = 0.3f;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionReveal;
    [self.navigationController.view.layer addAnimation:transition forKey:nil];
    [self.navigationController pushViewController:phoneServicesViewController animated:NO];
    

提交回复
热议问题