Paolo Pascua
Paolo Pascua

Reputation: 123

iOS 7 supportedInterfaceOrientation not working as intended

So I have root controller that can rotate to any orientations and a view controller that only shows landscape mode using supportedInterfaceOrientations

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

So when I present that view controller by setting the window's root controller to be that at some point of the app, like button press, it starts on landscape mode. Everytime it rotates it calls that method. But when I rotate to portrait it went portrait even though I told them to use landscape only. Any advice?

Upvotes: 0

Views: 1907

Answers (1)

matt
matt

Reputation: 535168

The problem is that only the topmost view controller is consulted. For example, if you have a navigation controller and its root view controller, only what the navigation controller says is important. (And you can use the navigation controller delegate's navigationControllerSupportedInterfaceOrientations: to give the answer you want.)

Upvotes: 2

Related Questions