1.导航控制器的多级pop中,获取之前的控制器
NSArray *vcsArr = self.navigationController.viewControllers;
2. 隐藏导航栏的返回按钮
//去除back
[self.navigationItem setHidesBackButton:YES];
3navigationbar的属性设置
设置titleItem、rightItem 、leftItem的自定义;
1、另设置label、btn控件,添加到item上
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:[UILabel new]];
2、直接通过attributs修改属性
NSDictionary *textAttr = @{NSForegroundColorAttributeName: KgrayTextColor, NSFontAttributeName:[UIFont systemFontOfSize:14]};
[self.navigationItem.rightBarButtonItem setTitleTextAttributes:textAttr forState:UIControlStateNormal];
[self.navigationItem.rightBarButtonItem setTitleTextAttributes:textAttr forState:UIControlStateHighlighted];
网友评论