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

后端 未结 8 1057
陌清茗
陌清茗 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 12:05

    Override the viewWillDisappear method of your underMapViewController with something like this:

    - (void)viewWillDisappear:(BOOL)animated
    {
        curlableMapViewController.view.frame = CGRectMake(0.f, 0.f, 320.f, 416.f);
    
        [super viewWillDisappear:animated];
    }
    

    That corrects the size of the view of the curlableMapViewController to the know size you specify, which you could save earlier in the viewWillAppear method, for example.

提交回复
热议问题