/**
导航控制器掌握:
1.创建导航控制器
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:self.viewController];
2.zhan (zhan 中所有的子控制器)
self.navigationController.viewControllers;
3.将控制器压入zhan 中
[self.navigationController pushViewController:second animated:YES];
4.将控制器从zhan 中弹出
1>将zhan 顶控制器弹了
5.导航栏显示的内容
//弹回zhan顶
//[self.navigationController popViewControllerAnimated:YES];
//回到 底控制器(根控制器)
//弹回zhan 底
[self.navigationController popToRootViewControllerAnimated:YES];
//回到哪 人控制器
//[self.navigationController popToViewController:animated:YES];
5.导航栏显示的内容
//zhan 顶控制器的navigationItem属性
self.navigationItem.title = @"你好世界";
self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:nil action:nil];
//设置下一个界面的返回按钮
self.navigationItem.backBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil];
/zhan 顶控制器的navigationItem属性决定了导航栏显示的东西@
//导航栏左边的返回键,是由上一个键决定的
//self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:nil action:nil];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"设置" style:UIBarButtonItemStyleDone target:self action:@selector(clickSetting)];
// Do any additional setup after loading the view from its nib.
6.//zhan 顶控制器
self.navigationController.topViewController;
*/
原文:http://www.cnblogs.com/jackluo/p/3918254.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!