Support for all orientation in the controller morenavigationcontroller and child viewcontroller inside the tabbarcontroller iOS 6

I have a tab app. I set the orientation for the tabs by installing the tab bar controller in the Windows root window controller and then overriding the behavior of the navigation manager and tabbacontroller by subclassing (although not recommended). Orientation now works in all tabs, with the exception of more navigation controllers and its children. I know that the problem is that the device rotation notification is not sent to the child view controllers inside the morenavigation controller in the tab bar controller. In addition, a larger navigation controller has a readonly property.

My problem is that I want to maintain all the orientation in the morenavigation controller and in the children's controllers. Now shoulautorotate inside the children see that the morenavigation controller controllers are not called.

+4
source share
1 answer

After iOS 6, Apple changed the orientation of applications in applications. Check out the following thread. It helps a lot.

Ios 6 navigation controller tablet controller

Or you can create your own tabbarcontroller and implement the following methods

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // You do not need this method if you are not supporting earlier iOS Versions return [self.selectedViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } -(NSUInteger)supportedInterfaceOrientations { return [self.selectedViewController supportedInterfaceOrientations]; } -(BOOL)shouldAutorotate { return YES; } 
+1
source

Source: https://habr.com/ru/post/1443424/


All Articles