Question

I have a piano app in the App Store. It works in landscape mode.

enter image description here

Now iOS 7 appears to be ignoring the Landscape setting in IB

enter image description here

The app works as expected in iOS 6 and below, in landscape. In iOS 7 appears in portrait. Here are settings and relevant code:

enter image description here enter image description here

//iOS 6+
- (BOOL)shouldAutorotate
{
    return YES;
}

//iOS 6+
- (NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight);
}
//iOS 5.1.1-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Was it helpful?

Solution

Thanks to @shawnwall comment I realised I didn't have a Root View Controller. In the past my app given support yo iOS 3.1.3 O_O:

[self.window addSubview:self.viewController.view];

I dropped 3.1.3 support a long time ago, so I can set up a root view controller:

self.window.rootViewController = self.viewController;

That was the thing that caused the visual bug.

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