tabBarController and navigationControllers in landscape mode, episode II

前端 未结 7 2036
轻奢々
轻奢々 2020-12-08 09:11

I have a UITabBarController, and each tab handles a different UIViewController that pushes on the stack new controllers as needed. In two of these tabs I need, when a specif

7条回答
  •  长情又很酷
    2020-12-08 09:28

    This worked for me:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        if(self.selectedIndex == 0 && [[[self.viewControllers objectAtIndex:0] visibleViewController] isKindOfClass:[MyViewController class]])
            return YES;
        else
            return NO;
    }
    

提交回复
热议问题