iphone - How can I have a UISegmentedControl swap views in and out, AND still have the ability to rotate orientation? -


i have looked around @ number of posts on topic, have been unable fix issues having. presenting modal view uiviewcontroller. i've setup view have uisegmentedcontrol on top right ideally allow me switch view (inside of modal view).

in order not cover toolbar @ top, have made simple uiview in ib, , laid out dimensions don't overlap toolbar. thinking if add view want add uiview when uisegmentedcontrol selected, life great:

-(ibaction) indexdidchangeforsegmentedcontrol:(uisegmentedcontrol*)seg{  int selectednum = seg.selectedsegmentindex;  if([[self.view1 subviews] objectatindex:0] != nil){     [[[self.view1 subviews] objectatindex:0] removefromsuperview]; }  if(selectednum == 0){     [self.view1 addsubview:[(dialoginfo*)[viewsarray objectatindex:seg.selectedsegmentindex] view]]; }else if(selectednum == 1){     [self.view1 addsubview:[(dialogmetadata*)[viewsarray objectatindex:seg.selectedsegmentindex] view]]; }else if(selectednum == 2){     [self.view1 addsubview:[(dialogversions*)[viewsarray objectatindex:seg.selectedsegmentindex] view]]; }else if(selectednum == 3){     [self.view1 addsubview:[(dialogassoc*)[viewsarray objectatindex:seg.selectedsegmentindex] view]]; }  } 

and works! problem when rotate device, view care about, inner one, won't spin.

i have tried not doing outer parent uiview approach, , tried setting view controller view frame, orientation still messed up.

i have tried doing uinavigationcontroller, , not animating transition, can't work correctly.

so question is: do?! want able switch between views uisegmentedcontrol , able rotate device orientation need. i've thought through , tried many different things feel don't have clue happening anymore.

thank help

well turns out after poking around more resize mask wasn't set in ib. doh!


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -