UISplitViewController shrinks left side when rotating with Menu popover visible
I've never seen this happen before and I can't figure out what is causing it, mayb开发者_Go百科e you can help. I have a UISplitViewController as my root view controller. The left side is a UINavigationController with a table view controller. I can rotate from potrait to landscape and back again over and over without any problems. However, if I'm in portrait and I tap the Menu button to show the UIPopoverController containing the left side nav controller and rotate to landscape while the menu is visible the left view with the nav controller gets thinner! The left side gets about 30 pixels thinner and a gap shows up between the left side and the detail view controller.
I'm flabberghasted. Any ideas?
EDIT: The popover menu doesn't need to be visible during the rotation. It only needs to have been shown while in portrait for the sizing issue to happen. I don't have any code that changes the size of anything in my UISplitViewController delegate methods. I only update the toolbar in the detail view controller to add/remove the Menu bar button item. I've logged the frame size of the left-side controller before/after/during rotation and before/after/during showing in the popover and it is always showing as 320 wide.
Kenny
I found a solution. My detail view controller on the right side had a UIImageView which contained a background image. The background image was large enough for the portrait orientation, so it is larger than the UIImageView is when it has been resized for landscape view. It's Content Mode was set to Center. For some reason that is the cause of the size reduction of the left side view (even though the left side frame never changed at any point). Checking the "Clip Subviews" checkbox in the xib for my detail view controller seems to have solved the problem.
精彩评论