cocoa touch - Handling Orientation with Multiple Windows on iPad -


i have ipad application goes between 2 states, 1 using splitview other tableview.

currently have single uiwindow object, , switch between views following code

-(void) switchtostatea { [viewcontrollerb.view removefromsuperview]; [window addsubview:viewcontrollera.view]; } -(void) switchtostateb { [viewcontrollera.view removefromsuperview]; [window viewcontrollerb.view]; } 

everything works fine unless change device orientation. after changing orientation , switching states, state not active during change still in frame of old state (leaving black areas @ edge of display). if change orientation again new state fixed.

i've tried adding

[viewcontrollera.view setneedslayout]; 

after swapping views did not have effect.

how make sure background view controllers orientation callback, or how invoke 'refresh' when switch state?

this pure speculation on part, if instead of removing view controller's view window, set view hidden , use exchangesubviewatindex:withsubviewatindex: change view controller's view visible user. wonder if os optimizing not sending rotation events view controllers views don't have super view.

you fancy animations , fade top view's alpha 0 while bottom view's alpha fades 1 before switch places.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -