objective c - autoresize of uiview -
i have uiview
in uitabcontroller
. , there uitableview
in it.
when toggling in call status bar doesn't , view not automatically resized.
it assumes right size based on whether in call uistatusbar
toggled when app starts if uistatusbar
toggled whilst app running nothing changes.
another tab view uinavigationcontroller
seems resize fine.
here code
if ([indexpath indexatposition:0] == 0 || [indexpath indexatposition:0] == 1) { if (!airportchooser) { airportchooser = [[airportchoosercontroller alloc] init]; airportchooser.targetcontroller = self; airportchooser.view.autoresizessubviews = yes; airportchooser.view.autoresizingmask = uiviewautoresizingflexibleheight; [airportchooser.view setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexiblewidth]; } airportchooser.target = [indexpath indexatposition:0]; [self.parentviewcontroller.parentviewcontroller.view addsubview:airportchooser.view]; self.parentviewcontroller.parentviewcontroller.view.autoresizessubviews = yes; self.parentviewcontroller.parentviewcontroller.view.contentmode = uiviewcontentmoderedraw; [self.parentviewcontroller.parentviewcontroller.view setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexiblewidth]; airportchooser.view.contentmode = uiviewcontentmoderedraw; //[airportchooser open]; }
did set resizing mask of uiview
correctly? can set in interface builder
in size tab, it's red lines can click.
you can set in code using like:
[view setautoresizingmask:uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight];
also make sure superview has set autoresizessubviews
yes.
you can find more information in uiview documentation.
Comments
Post a Comment