Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

supportedInterfaceOrientations not working

I have Tab Bar Controller app with three UIViewController, all done in storyboard.
Device orientation is set to all, except Upside Down.

For one UIViewController, I have following code:

- (BOOL) shouldAutorotate {
     return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationPortrait;
}

But still I can rotate.
Should not supportedInterfaceOrientations limit that ?

like image 845
WebOrCode Avatar asked Apr 13 '26 18:04

WebOrCode


1 Answers

If you are using NavigationController then you should place your code inside the NavigationController class.

like image 175
Lawliet Avatar answered Apr 15 '26 10:04

Lawliet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!