How can I use UIModalTransitionStylePartialCurl on a UIView that does NOT take up the whole screen?

后端 未结 8 1205
陌清茗
陌清茗 2021-01-30 11:06

In Apple\'s official Maps app for the iPhone, there is a small \'page curl\' button in the lower-right corner. When you press it, the map itself peels back to reveal some optio

8条回答
  •  不要未来只要你来
    2021-01-30 11:49

    How about something like this:

        [UIView beginAnimations:@"PartialPageCurlEffect" context:nil];
        [UIView setAnimationDuration:0.3];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
        [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:myOldSubViewController.view cache:YES];
    
        [myOldSubViewController.view addSubview:myNewViewController.view];
    
        [UIView commitAnimations];
    

    Note: for some views if the views are complex and off-centre there could be artifacts. Changing cache:YES to cache:NO may fix with.

提交回复
热议问题