ios8 UIModalTransitionStylePartialCurl doesn't

2020-03-24 05:50发布

问题:

Under ios 8 using presentViewController modalTransitionStyle = UIModalTransitionStylePartialCurl disappear all page. I want it to work like ios 7.

回答1:

I had the same issue and I applied this fix, it worked for me on iOS 8 and Xcode 6.

    [_mapToolbarController setModalTransitionStyle:UIModalTransitionStylePartialCurl];
    [self presentViewController:_mapToolbarController animated:YES completion:^{
        [_mapToolbarController.view.superview addSubview:self.view];
    }];

Obviously, _mapToolbarController will be the controller that you want to present. To see why you'd need this, add a breakpoint at the line in the completion handler. Do the animation, and you'll see in the completion handler that the curling animation had just finished and everything was perfectly fine. For some reason that I can't explain, in iOS 8 you'll need to tell the iOS framework to "keep" the curled view and make sure it doesn't get thrown away. The code in the completion handler tries to "keep" the soon-to-be-faded curled view onto the screen. Note that in this context, self.view is the view that is being curled.



回答2:

You can always try to make your own transitions with iOS 7. Have a look HERE



回答3:

Well, I am not proud of the fix I came up with but it works just fine and took me little time to do it.

I managed to get a screen shot of the page curl at the stage that I wanted it to remain. It took a few tries but I got it. Then I took that image into Pixelmator and cropped it to just the page curl portion, made everything else transparent, smudged out the extraneous artifacts like the battery indicator, signal bars and time.

I imported that image in 320, 640 and 960 widths then insert it at the top of my presented view at load time. It came out virtually perfect. I cannot tell the difference from what I had before. Works exactly as I wanted it.