Ryan
Ryan

Reputation: 4884

How to fix a viewcontroller's rotation?

My app uses landscape only. I fixed it via .plist's Supported interface orientations.

However, I need to use UIImagePickerController, and it only supports portrait mode. How can I rotate my app's rotation to portrait in a specific viewcontroller?

Any tips will be very helpful! Ty!

Upvotes: 0

Views: 75

Answers (2)

Ryan
Ryan

Reputation: 4884

ColinE, Do you mean that I should set as below?

All other viewControllers

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || UIInterfaceOrientationLandscapeLeft); 
}

and set the portarit page

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation == UIInterfaceOrientationPortrait); 
}

Upvotes: 0

Related Questions