UISplitView new slide-in popover becomes fullscreen after memory warning in iOS 5.1

后端 未结 2 1364
清歌不尽
清歌不尽 2021-01-06 02:46

I\'m quite new here. I have a problem with the new iOS 5.1 slide-in popover in UISplitView. (Before 5.1 the master view controller was presented in a popover, but now it sim

相关标签:
2条回答
  • 2021-01-06 03:01

    I had the same problem, but I used this code to solve the problem:

    -(void)splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController
    {
        aViewController.view.frame = CGRectMake(0, 0, 320, self.view.frame.size.height);
    }
    

    Apparently when a memory warning is received, the view controller gets released, so when it presents itself again, it gets it's size from it's parent view, which is full screen. So you just have to reset the frame every time it gets loaded.

    0 讨论(0)
  • 2021-01-06 03:18

    I had the same trouble.

    You should add below code to AppDelegate.

    splitViewController.presentsWithGesture = NO;

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