Reputation: 62
recently I found a project with a page view controller which I really liked and decided to use in my own project.
http://www.wannabegeek.com/?p=168
The problem is, The page controller starts out in portrait and has an auto rotate feature to landscape. For my purposes, I don't need any auto rotate feature, I just want to be able to swipe back and forth between views in landscape mode only.
I tried changing the code, but was unsuccessful in making it landscape only, If someone could help edit the code to NOT auto-rotate, start in landscape, and stay in landscape that would be great!
Thank you.
Upvotes: 0
Views: 260
Reputation: 520
Lemme add more detail to Shivan's answer:
2.In the ViewController.m look for shouldAutorotateToInterfaceOrientation, make it return NO. See the following code.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}
Upvotes: 0
Reputation: 54258
You have to perform 2 changes :
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
to return NO
Upvotes: 1