简体   繁体   中英

iOS6 Autorotation when switching back from support orientation to not supported orentation view

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM