i'm having problems making app ipad compatible.
i have implementation of custom tab bar, based on post here http://www.wiredbob.com/blog/2009/4/20/iphone-tweetie-style-navigation-framework.html
that works fine apart when device rotated. selected view rotates , resizes perfectly. every other view rotates not resize fill space. there large white column down right hand side.
i've tried adding
self.view.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight; self.view.autoresizessubviews = yes;
to tab controller view.
i've added similar code tab's views viewdidload methods.
i've tried make willrotatetointerfaceorientation call subviews rotation methods still no luck.
any suggestions more welcome @ stage. i'm hoping i'm not overlooking obvious might be. i've been @ few hours now
screenshot 1 - screenshot
ok solved problem.
what had manually call resize on sub views. - added changeframesize function each sub view (just made code little nicer)
oh , when adding views sub views use belowsubview method -
[self.view insertsubview:viewcontroller.view belowsubview:tabbar]; -(void) didrotatefrominterfaceorientation:(uiinterfaceorientation)frominterfaceorientation { [(viewcontrollerclass *)[viewcontrollers objectatindex:0] changeframesize:[nsnumber numberwithfloat:self.selectedviewcontroller.view.bounds.size.width] height:[nsnumber numberwithfloat:self.selectedviewcontroller.view.bounds.size.height]]; [(viewcontrollerclass *)[viewcontrollers objectatindex:1] changeframesize:[nsnumber numberwithfloat:self.selectedviewcontroller.view.bounds.size.width] height:[nsnumber numberwithfloat:self.selectedviewcontroller.view.bounds.size.height]]; [(viewcontrollerclass *)[viewcontrollers objectatindex:2] changeframesize:[nsnumber numberwithfloat:self.selectedviewcontroller.view.bounds.size.width] height:[nsnumber numberwithfloat:self.selectedviewcontroller.view.bounds.size.height]]; }
so because selected view controller rotated , resized correct size, once had rotated , adjusted passed same parameters sub views resize too.
Comments
Post a Comment