objective c - SplitViewController's master side sometimes is not rendered correctly when changing orientation in IOS 6.1 -
objective c - SplitViewController's master side sometimes is not rendered correctly when changing orientation in IOS 6.1 -
i have tab bar controller has tabitems. of tabitems splitviewcontrollers. sometimes, when alter orientation, left side of splitview controller not render correctly, have black square in bottom. changing orienation again, problem solved.
there nil special in code. in viewdidload have:
[self.navigationcontroller setnavigationbarhidden:yes]; self.splitviewcontroller.delegate = self;
and 1 splitviewcontroller delegate method handled trivially:
- (bool)splitviewcontroller:(uisplitviewcontroller *)svc shouldhideviewcontroller: (uiviewcontroller *)vc inorientation:(uiinterfaceorientation)orientation { homecoming no; }
i have nil more, tableview on cells on detail side.
i've seen such issue , workaround came reset size of left side view controller's view , it's navigation controller's view:
- (void)didrotatefrominterfaceorientation:(uiinterfaceorientation)frominterfaceorientation { if (self.splitviewcontroller) { viewheight = ... navviewheight = ... cgrect viewframe = cgrectmake(0, 0, 320, viewheight); self.view.frame = viewframe; cgrect navcontrollerviewframe = cgrectmake(0, 0, 320, navviewheight); self.navigationcontroller.view.frame = navcontrollerviewframe; } }
where viewheight , navviewheight can calculate screen height depending on current orientation (which has been set when didrotatefrominterfaceorientation: called). guess these values should equal you hide navigation bar.
ios objective-c ipad storyboard uisplitviewcontroller
Comments
Post a Comment