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;
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。