UISplitView New slide pop-up becomes full-screen after warning about memory in iOS 5.1

I am completely new here. I am having a problem with the new iOS 5.1 slider in UISplitView. (Prior to 5.1, the main view controller was presented in popover, but now it just slides in the form on the left.) When my device is in portrait mode and receives a memory warning, the main view controller is unloaded; and when I click the toolbar button to navigate the main view, it loads again. However, after a warning about the memory, it is displayed in full screen mode, and not just in the size of the original main view. (When I turn the device to the landscape and return to the portrait, it will return its correct size.)

Prior to iOS 5.1, it was always displayed in a popover with the correct size.

Anyone have an idea how to fix this?

I tried to set the frame size of the main view, but this does not solve the problem.

Any help is much appreciated!

+5
source share
2 answers

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 warning about saving memory is received, the view controller is freed, so when it appears again, it gets from it the size of the parent view, which is full-screen. So you just have to reset the frame every time you boot.

+5
source

I had the same problem.

You must add the code below in AppDelegate.

splitViewController.presentsWithGesture = NO;

0
source

All Articles