0

I have a UITabBarViewController that contains 5 tabs and a login view which is not part of my tab bar, in my settings I have set that I support all device orientations. but when I run my app, only my login view is the only which rotates.

I have created a custom UITabBarController and implemented these methods

-(BOOL)shouldAutorotate
{
   return YES;
}

-(NSUInteger)supportedInterfaceOrientations
{
  return UIInterfaceOrientationMaskAll;
}

still my tabbar doesn't rotate, but I can see that my status bar disappears when change my device orientation to landscape.

How can I solve this?

user2037296
  • 409
  • 1
  • 5
  • 13
  • Make sure all five individual view controllers can rotate accordingly too. – Hermann Klecker Jun 22 '15 at 11:35
  • And double check that all view controllers are properly connected to their related tabs when you use interface builder/storyboard. Don't have empty tabs. (the connected view may be empty but there should always be a view controller.) – Hermann Klecker Jun 22 '15 at 11:43

2 Answers2

1

Try to override this method, don't call super

- (void)viewWillTransitionToSizeCGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
    //[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
    [self.selectedViewController viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
} 
Alex Cheng
  • 829
  • 8
  • 20
0

I also had a similar problem on Xcode 7, iPad 2, iOS 9.

The view controllers were not passing down the shouldAutoRotate message correctly. I ended up having to uncheck the PortraitUpsideDown option for the project and for some reason, that ended up fixing the issue.

Endama
  • 743
  • 8
  • 25