Take the 2-minute tour ×

I have an app made up of a lot of view controllers... in the project summary I've set Portrait orientation as the only supported device orientation.

However, the app still gets messed up when turned sideways.

My question is, is there a way to globally disable autorotation through app delegate or something?

Or do I have to go into all of my view controllers and add the "shouldAutorotateToInterfaceOrientation" method?

Just don't want to miss adding it to one or something...


share|improve this question
It's been a while since I've done iOS, but isn't there something you can put in the app plist? Something about "supported orientations" or something like that? –  Paul Tomblin Apr 12 '12 at 14:04
add comment

3 Answers

up vote 4 down vote accepted

in root view controller's method:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);

set 'return NO';

this should do for all the Views.

share|improve this answer
great thanks. Will accept answer when it lets me –  sayguh Apr 12 '12 at 14:06
Thats very kind of you :).. –  Haris Hussain Apr 12 '12 at 14:09
it didnt work for me –  ayilmaz May 27 '13 at 7:09
add comment

In Info.plist expand "Supported interface orientations" and remove Landscape items to make your application only run in portrait mode

share|improve this answer
add comment

After struggling to set in UIViewController's shouldAutorotate and supportedInterfaceOrientation methods, with no success in iOS6, I found the most effective is to set it in app delegate.

    return UIInterfaceOrientationMaskPortrait;

However returning UIInterfaceOrientationMaskPortraitUpsideDown was crashing my app. I dont know whats wrong I was doing!

share|improve this answer
add comment

Your Answer


