Saturday, December 7, 2013

UITabBarController the orientation problem.

MyCardInfoController * myCardInfoController = [[MyCardInfoController alloc] init];
UINavigationController * nav2 = [[SCUINavigationController alloc] initWithRootViewController: myCardInfoController];
[Controllers addObject: nav2];

UITabBarController * tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = controllers;
In response to an event of my own approach, its own structure UITabBarController, whose elements are UINavigationController, but its roots as my custom UIViewController, has been reported this error Runtime:

The view controller returned NO from _shouldAutorotateToInterfaceOrientation: for all interface orientations It should support at least one orientation
..
For my custom UIViewController's - (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation {
return NO;
}
Various attempts were made, all to no avail, please help us to see Daren, thank you.
Reply:
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

Do not do that?
Reply:
Try a variety, but later found the problem is not here.
Reply:
When calling presentModalViewController also appeared once
The
self.navigationItem
Replaced by self
Enough

No comments:

Post a Comment