4

As every iOS developer is now a days sturggling with autorotationg features changed with iOS6 launching with concerned to that i have one problem:

As my application supports UIInterfaceOrientationMaskPortrait but for few view controllers i want to support all UIInterfaceOrientationMaskPortraitAll i implemented it as following :

in my rootviewcontrller that is in my case navigation contrller :

- (BOOL)shouldAutorotate
{
    return self.topViewController.shouldAutorotate; //you are asking your current controller what it should do
}

in my viewcontrllers :

-(BOOL)shouldAutorotate
{
    return //if view supports auto orientation then return yes else no
}

all is working well but 1 problem is... suppose my 2nd view supports all orientations and 1st view only supports only portrait then if I rotate 2 view and get back if i my current view orientation(view2) is landscape then view1 will also not rotate to its supported orientation.

so how to overcome from this problem please if any then solutions are welcome.

Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
Laxmikant
  • 41
  • 1
  • How are you getting back to view1 from view2? – jjpp Jan 19 '13 at 11:42
  • Take a look at these answers on SO already (http://stackoverflow.com/questions/12504464/ios-6-uitabbarcontroller-supported-orientation-with-current-uinavigation-control) and/or this (http://stackoverflow.com/questions/12551247/autorotate-a-single-uiviewcontroller-in-ios-6-with-uitabbar) – july Apr 26 '13 at 18:02

1 Answers1

0

Try to reset your view orientation in viewDidLoad method. Solved it in my case.

Regexident
  • 29,441
  • 10
  • 93
  • 100
Krupal Ghorpade
  • 137
  • 1
  • 15