2010-04-17 5 views

Répondre

3

Faire le volet « maître » de UISplitViewController un UINavigationController, puis il suffit de pousser UIViewController s sur ce qui ont navigationItem s.

Voici un exemple de configuration:

UIViewController *masterController = [[MyCustomMasterController alloc] init…]; 
[[masterController navigationItem] setTitle:@"Root"]; 

UINavigationController *navController = 
    [[UINavigationController alloc] initWithRootController:masterController]; 

UIViewController *detailController [[MyCustomDetailController alloc] init…]; 

UISplitViewController *splitView = [[UISplitViewController alloc] init]; 
[splitView setViewControllers:[NSArray arrayWithObjects:navController, 
                 detailController, 
                 nil]]; 

Et puis plus tard:

UIViewController *subController = [[MyCustomSubController alloc] init…]; 
[[masterController navigationController] pushViewController:subController 
                animated:YES]; 

Pousser un nouveau UIViewController à pile de la UINavigationController provoquera un bouton retour intitulé « Racine » apparaître pour la vue MyCustomMasterController.

Questions connexes