I am presenting a modal view controller like this from a table view (ignore the memory leaks, just testing..):
[self presentModalViewController:[[SignatureVC alloc] init] animated:YES];
and in my SignatureVC, I am implementing this:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
I want SignatureVC to be only in landscape mode. However, after presenting the modal view controller, the orientation doesn’t change.
What am I doing wrong? Thanks.
The method
-shouldAutorotateToInterfaceOrientation:does not rotate the interface orientation. It merely allows the interface orientation to rotate if the device orientation rotates.If the modal view appears when the device is in portrait, then it will be in portrait. However, once you rotate to landscapeLeft, it will remain locked in that orientation with this code.
To force the interface to rotate, you can use