Search code examples
iphoneiosxcodeios4device-orientation

xcode 4.2.1 - rotation support issue


I have designed an app to support ios 4.3 and from "Supported Device Orientations" I removed everything and only portrait is active.

The problem is that when I simulate the app in my phone it supports all the orientations and my app looks missed up with the landscape orientations.

how can I force it not to support landscape orientations?


Solution

  • In your view controller call

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

    to force it not to rotate in landscape mode. You will also need to make sure all of your parent views have autoresizesSubviews = YES.