1.设置导航栏标题,对于每一个视图控制器都有一个自己的导航栏标题
self.title=@"第一种方法";
self.navigationItem.title=@"第二种方法";
2.视图是以出栈和压栈的方法压入和弹出视图控制器
压入:[self.navigationController pushViewController:yourpushViewController animated:YES];
弹出:[self.navigationController popToRootViewControllerAnimated:YES]
//animated表示是否以动画的方式压入和弹出,还有一些类似的方法,就不一一列举
3.设置导航栏和工具栏隐藏属性
- (void)setToolbarHidden:(BOOL)hidden animated:(BOOL)animated;
- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated;
4.设置导航栏按钮,设置工具栏按钮
UIBarButtonItem * barButton = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(editButtonClick)];
self.navigationItem.leftBarButtonItem = barButton;
UIBarButtonItem * shareBUtton =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(editButtonClick)];
NSArray * array = [NSArray arrayWithObjects:shareBUtton,nil];
self.toolbarItems=array;
转载于:https://blog.51cto.com/8947509/1580165