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

后端 未结 2 1365
清歌不尽
清歌不尽 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.

提交回复
热议问题