-5

これは私の AppDelegate です。タイトルを「ピザ」に設定しましたが、アプリケーションをビルドして再生すると、テキストが表示されません。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

UITabBarController *tabBarController = [[UITabBarController alloc]init];
ListaPizzeViewController *listPizzeVC = [[ListaPizzeViewController alloc]init];

UINavigationController *navigationControllerPizza = [[UINavigationController alloc]initWithRootViewController:listPizzeVC];
[navigationControllerPizza setTitle:@"Pizza"];
navigationControllerPizza.tabBarItem.image = [UIImage imageNamed:@"Default.png"];


  ListIngredientsViewController *listIngredientVC = [[ListIngredientsViewController alloc]init];
UINavigationController *navigationControllerIngradient = [[UINavigationController alloc]initWithRootViewController:listIngredientVC];
[navigationControllerIngradient setTitle:@"Ingredient"];
navigationControllerIngradient.tabBarItem.image = [UIImage imageNamed:@"Default.png"];

[tabBarController setViewControllers:@[navigationControllerPizza, navigationControllerIngradient]];

[self.window setRootViewController:tabBarController];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}

なんで?

4

6 に答える 6

2

viewDidLoad書き込み内のListaPizzeViewControllerに入ります

self.title = @"Pizze";
于 2013-09-03T12:59:25.040 に答える
1

viewWillAppear メソッドでタイトルを設定してみてください。

「listPizzeVC」の

self.title=@"Pizza";
于 2013-09-03T13:02:43.083 に答える
1
self.navigationItem.title=@"pizza";

これを呼び出すだけです。

于 2013-09-03T12:59:06.193 に答える