0

私は iOS 5 で正常に動作する iPad アプリを持っています。私のアプリ ルート viewController は UITabBarDelegate と UINavigationControllerDelegate を実装しています。しかし、iOS 6 では、最初の実行時に一度だけ tabBar を表示できます。2番目に。3 回目などで実行され、tabBar が消えます。それでWFT?%-)

これが私の AppDelegate の applicationDidFinishLaunching:application です。

- (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;
}
4

0 に答える 0