Monday, 10 September 2012

Help! Problems appear when rotate device to Landscape


hi all,

developing ipad application. in ipad application, views must portrait , landscape supported. found out way make views can autorotate set shouldautorotatetointerfaceorientation method return yes. so, views in application can autorotate based on device orientation. appear many problems ... ...

1 of problem need clarify when ipad device rotate landscape, saw status bar can aligned landscape nicely view appear rectangle right side cut-off. think may view autoresize problem... set autosizing property in interface builder under size inspector uiviewautoresizingflexiblewidth , uiviewautoresizingflexibleheight selected. still didn't solve problem... , problem happens views except root view, wondering possible caused views hierachy of application not organised well? , problem not appear when run in ipad simulator.

after few days research, found out solution, first time develop ipad application, don't know corrrect or not... hope can give me ideas... have listed solutions below:

1.) when display views using -(void)presentmodalviewcontroller: (uiviewcontroller *)modalviewcontroller animated: (bool)animated, views can autoresize when rotate ipad device landscape. when display them using - (void)addsubview: (uiview *)view, problem happens again...

2.) reset frame size based on status bar orientation in viewdidload method. correct solution since need reset frame size every views in application every time loaded?

so, correct way solve problem?

need advice , opinion solve problem ... comments welcome. lot :)
 



Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment