ios - View presented from master panel of UISplitViewController not rotating when rotated from portrait to landscape (iPad) -
i presenting modal view , action sheet master panel of uisplitviewcontroller
. ios 9.3
1) if present view when ipad in portrait mode , rotate ipad landscape, screen not rotating.
2) if present view when ipad in landscape mode , rotate ipad portrait, screen rotating.
how can achieve rotation?
there 2 solutions resolve issue:
it not ideal present modal views master panel should doing uisplitviewcontroller itself.
splitviewcontroller.preferreddisplaymode =uisplitviewcontrollerdisplaymodeallvisible; // displaying master panel in screen shot in question modalviewcontroller.modalpresentationstyle = uimodalpresentationformsheet; // displaying modalviewcontroller in form sheet style [splitviewcontroller presentviewcontroller:modalviewcontroller animated:true completion:nil]; // note: modalviewcontroller presented uisplitviewcontroller , not master panel of split view
the master panel of spilt view presented in popover when in portrait mode device rotation changes have go through popovercontroller. guessing chain breaks @ points. so, resolve issue call
[splivc setpreferreddisplaymode:uisplitviewcontrollerdisplaymodeprimaryhidden];
before modal presentation segue called(from prepareforsegue
). not sure of whether delegates working approach.
edit: have observed if split view in uisplitviewcontrollerdisplaymodeallvisible
mode presenting modal vc master panel(lets simple modal segue in storyboard) not give rotation issue. have confirmed in ios 9.3 simulator.
Comments
Post a Comment