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!
Asked
Active
Viewed 2,756 times
1 Answers
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:
- 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:).
- In your root view controller implement shouldAutorotateToInterfaceOrientation: as follows:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); }