ios - How to add tabbar controller as child view to parent view? -
- (void)viewdidload { [super viewdidload]; uitabbarcontroller *controller = [self.storyboard instantiateviewcontrollerwithidentifier:@"tabbar"]; [self addchildviewcontroller:controller]; controller.view.frame = cgrectmake(0,0, 500, 500); [self.view addsubview:controller.view]; [controller didmovetoparentviewcontroller:self]; }
how can add tabbar viewcontroller child view uiviewcontroller in objective-c?
as mentioned doing here [self.view addsubview:controller.view]
the autoresizing mask of view of tabbar controller assumes full size of superview.
if set frame when instantiating tabbar controller, sure change autoresizingmask
property of tabbar's view doesn't have flexible width or flexible right margin.
Comments
Post a Comment