美文网首页
navicontroller/naviBar

navicontroller/naviBar

作者: 乐乐的熊 | 来源:发表于2018-11-26 10:00 被阅读0次

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];

相关文章

网友评论

      本文标题:navicontroller/naviBar

      本文链接:https://www.haomeiwen.com/subject/zfmvqqtx.html