0

How do I change the view to be horizontal. I do not want it to switch when the iphone is turned on its side, I want it to be permanently horizontal. Thanks!

issac
  • 1,501
  • 6
  • 22
  • 29

1 Answers1

0

Note: There are several "landscape" related questions/answers already on stackoverflow (query). But to answer your question directly, here's a high level summary of Apple's official documentation for this this topic:

  1. Add UIInterfaceOrientation to Info.plist with string value UIInterfaceOrientationLandscapeRight (or UIInterfaceOrientationLandscapeLeft). Another option that accomplishes the same thing is to call UIApplication's setStatusBarOrientation:animated: method at startup (i.e., within applicationDidFinishLaunching:).
  2. In your root view controller implement shouldAutorotateToInterfaceOrientation: as follows:
    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
       return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    }
Community
  • 1
  • 1
clint
  • 14,402
  • 12
  • 70
  • 79