1

TTThumbsViewControllerをUITabBarController内に配置しようとしていますが、そのときにTTThumbsViewControllerのNavigationBarが表示されません。 NavigationBarがあるはずの空白があります。私はTTThumbsViewControllerだけをロードしました.NavigationBarはうまくロードされます。私はちょうど設定を逃したと確信していますが、私はそれが何であるか把握することはできません。ここでUITabBarController内のTTThumbsViewControllerでNavigationBarが表示されない

私はUITabBarControllerとTTThumbsViewControllerを作成するためにやっているものです:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.tabBarController = [[UITabBarController alloc] init]; 
    ThumbsViewController *thumbsViewController = [[ThumbsViewController alloc] init]; 
    UITabBarItem *thumbsTabBarItem = [[UITabBarItem alloc] initWithTitle:@"Thumbs" image:[UIImage imageNamed:@"icon.png"] tag:Thumbs]; 
    thumbsViewController.tabBarItem = thumbsTabBarItem; 
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:thumbsViewController, nil]; 
    self.window.rootViewController = self.tabBarController; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 

答えて

2

あなたはUITabControllerからTTThumbsViewControllerをロードしている場合は、UINavigationControllerを自分で作成する必要があります。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    self.tabBarController = [[UITabBarController alloc] init]; 
    ThumbsViewController *thumbsViewController = [[ThumbsViewController alloc] init]; 
    UITabBarItem *thumbsTabBarItem = [[UITabBarItem alloc] initWithTitle:@"Thumbs" image:[UIImage imageNamed:@"icon.png"] tag:Thumbs]; 
    thumbsViewController.tabBarItem = thumbsTabBarItem; 

    UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:ThumbsViewController] autorelease]; 

    self.tabBarController.viewControllers = [NSArray arrayWithObjects:navController, nil]; 
    self.window.rootViewController = self.tabBarController; 
    [self.window makeKeyAndVisible]; 
    return YES; 
} 
+0

ナビゲーションバーが表示されていましたが、TabBarが表示されません。 – baleful

+0

hmm。理想的には、TTNavigatorDemoサンプルアプリケーション – aporat

+0

のように、TTNavigatorを使用してTTUITabControllerをロードするのが理想的です。ThumbsViewControllerでhidesBottomBarWhenPushedをNOに設定する必要がありましたが、私の問題を解決しました。ありがとうございました。 – baleful

関連する問題