隐藏导航栏:
[self.navigationController setNavigationBarHidden:YES];
顶部导航左边按钮:
UIButton *leftNaviBtn = [UIButton buttonWithType:UIButtonTypeCustom];
leftNaviBtn.frame = CGRectMake(0, 0, 44, 44);// 设置不了位置属性,可以设置大小属性
[leftNaviBtn setBackgroundImage:[UIImage imageNamed:@"btn_more"] forState:UIControlStateNormal];
[leftNaviBtn addTarget:self action:@selector(clickOnLeftNavigationItem:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:leftNaviBtn];
self.navigationItem.leftBarButtonItem = leftItem;
设置顶部导航的背景颜色:
self.navigationController.navigationBar.barTintColor = COLOR_WITH_RGBA(512, 124, 200, 1);
[self.navigationController.navigationBar setTranslucent:NO];
设置顶部导航 title 颜色为白色:
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
设置导航栏上,按钮(如返回按钮)的颜色:
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
Hide 'Back' button on navigation bar:
self.navigationItem.hidesBackButton = YES;