Question

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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top