iphone - Refresh ViewController on TabBarController -
i have tabbarcontroller 3 viewcontrollers on it. when viewcontroller 1 selected , make 90 degrees hide tabbar , have addsubview current view tabbarcontroller, otherwise blank space appears tabbar was.
if rotate iphone orientation (the vertical normal position) removefromsuperview view, no view shown on view controller, suppose original view (the 1 before addsubview call) should shown, in fact if select second viewcontroller , later go viewcontroller 1 view appears perfectly.
i don´t understand why happens, me?
update:
i think problem add view on tabbarcontroller (self.view addsubview:vista_as.view]) need make tabbar not visible, , later, when remove view tabbarcontroller loses in way viewcontroller 0 view reference. don´t understand why when change viewcontroller 1 , 0 view ok. there way reload viewcontroller 0 view??
update 2: included author's code suggested edit answer
this code:
if(tointerfaceorientation == uiinterfaceorientationlandscapeleft || tointerfaceorientation == uiinterfaceorientationlandscaperight) { self.tabbar.hidden = true; vista_as = [delegate.tabbarcontroller.viewcontrollers objectatindex:0]; vista_as.view.frame = cgrectmake(0, 0, 320, 480); [self.view addsubview:vista_as.view]; } else { if ( (self.interfaceorientation == uiinterfaceorientationlandscapeleft) || (self.interfaceorientation == uiinterfaceorientationlandscaperight) ) { [vista_as.view removefromsuperview]; self.tabbar.hidden = false; }
it appears view controller 1 being deallocated, either due on releasing or system due memory. post code showing how attach , remove view covering tab bar. may hold answer.
Comments
Post a Comment