我有iPad应用程序在iOS 5上正常工作。我的应用程序根viewController实现了UITabBarDelegate和UINavigationControllerDelegate。但是在iOS 6上我只能看到tabBar一次 - 第一次运行。在第二个。第三个等运行tabBar消失。 WFT? % - )
这是我的AppDelegate的applicationDidFinishLaunching:应用程序:
- (void)applicationDidFinishLaunching:(UIApplication*)application
{
...
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
CGRect mainViewFrame = _window.frame;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
mainViewFrame.origin.y = CGRectGetHeight(statusBarFrame);
mainViewFrame.size.height -= CGRectGetHeight(statusBarFrame);
[self padMainController].view.frame = mainViewFrame;
[_window setRootViewController:[self padMainController]];
}
...
}
这是padMainController标题的片段:
@interface LTPadMainController : LTAutorotateController <UINavigationControllerDelegate, UITabBarDelegate>
和LTAutorotateController的片段:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad && UIDeviceOrientationIsLandscape(interfaceOrientation)) || (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && UIDeviceOrientationIsPortrait(interfaceOrientation)));
}
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}