Flip transition in iPhone

后端 未结 3 1773
温柔的废话
温柔的废话 2021-02-11 04:20

I am facing problems in flipping views in iPhone.

I have two views in appDelegate. I want to flip them once user clicks on a button.

I have the following code:

相关标签:
3条回答
  • 2021-02-11 04:58

    @Luke - thanks, this sample helped me...1 correction though (based on UIViewController.h)

    UIViewController *controllerForSecondView = ..;
    controllerForSecondView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controllerForSecondView animated:YES];
    

    From the header file comments:

    // Defines the transition style that will be used for this view controller when it is presented modally. Set this property on the view controller to be presented, not the presenter. // Defaults to UIModalTransitionStyleSlideVertical. @property(nonatomic,assign) UIModalTransitionStyle modalTransitionStyle

    0 讨论(0)
  • 2021-02-11 05:03

    If you're using the 3.0 SDK and all you want is a simple flip transition (ala the Weather app) then you don't need to go down to CATransition. The higher-level UIView animation transitions will do what you want but with 3.0 there is an even easier way: simply present your new view as a modal view controller and set the modal transition style to flip. From within the first controller:

    UIViewController *controllerForSecondView = ..;
    controllerForSecondView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controllerForSecondView animated:YES];
    

    Flip back again by using dismissModalViewController.

    Documentation Reference

    0 讨论(0)
  • 2021-02-11 05:07

    See The Elements sample code. Particularly AtomicElementViewController -flipCurrentView.

    0 讨论(0)
提交回复
热议问题