简体   繁体   中英

Black view instead of table

I got a tabbar application.

There is only 2 tabs in the tabbar. First tab is a NavigationController , second is a TableViewController . Second works perfect, but the the first doesn't.

When i start application, i saw black window. And there is not title on the NavigationBar.

self.navigationBar.topItem.title = @"Routes";

在此处输入图片说明

What's the problem? Thnx.

Well, you haven't pushed a view controller to your navigation controller yet. A navigation controller is just a container for another UIViewController .

Do something like this:

- (void)viewDidLoad {
  [super viewDidLoad]

  // Initialize an UIViewController here ...

  [self pushViewController:myRootViewController animated:NO];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM