Push ViewController from Right To Left with UINavigationController

后端 未结 11 1751
名媛妹妹
名媛妹妹 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 11:45

    No, right to left is reserved for popping viewcontrollers from the navigation stack. You can however get such an effect by animating the views yourself. Something like:

    [UIView beginAnimations:@"rightToLeft" context:NULL];
    CGRect newFrame = aView.frame;
    newFrame.origin.x -= newFrame.size.width;
    aView.frame = newFrame;
    [UIView commitAnimations];
    

    This will however not do anything to your navigation controller.

提交回复
热议问题