iphone - UIInterfaceOrientation landscape Vs Portrait issue in Xcode 5 -


i think have gone on every single post on topic. don't kill question yet till read. question xcode 5 on ios 7

i have app supports both landscape , portrait modes. in projects deployment info orientations checked.

when app launches show

  • v1viewcontroller (which should open in landscape mode)

when user hits button takes them

  • v3viewcontroller (which should open in portrait mode)

the problem have when app launches , holding iphone in portrait mode show this.

enter image description here

if swtich iphone in landscape mode shows this.

enter image description here

how can force v1viewcontroller show landscape mode?

this code have right now.

- (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation {     if (interfaceorientation == uiinterfaceorientationlandscapeleft || interfaceorientation == uiinterfaceorientationlandscaperight)     {         return yes;     }     else      {         return no;     }  } 

but if add view opens first picture show , rotation has no effect.

- (bool)shouldautorotate {      uiinterfaceorientation interfaceorientation = [[uiapplication sharedapplication] statusbarorientation];      nslog(@"interfaceorientation: %d ...", interfaceorientation);        if (interfaceorientation == uiinterfaceorientationlandscapeleft)     {         return yes;     }     else if (interfaceorientation == uiinterfaceorientationlandscaperight)     {         return yes;     }     else     {         return no;     }  }   - (uiinterfaceorientation)preferredinterfaceorientationforpresentation  {     return uiinterfaceorientationlandscapeleft;  }   -(nsuinteger)supportedinterfaceorientations  {      return uiinterfaceorientationlandscapeleft | uiinterfaceorientationlandscaperight;  } 

for interested in how got working, did.

- (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation {     return uiinterfaceorientationislandscape(interfaceorientation); }  -(nsuinteger)supportedinterfaceorientations {      return uiinterfaceorientationmasklandscape; }  - (uiinterfaceorientation)preferredinterfaceorientationforpresentation {     return uiinterfaceorientationlandscapeleft; } 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -