iOS设置导航条颜色及按钮颜色大小

//设置导航条颜色
    self.navigationController.navigationBar.barTintColor =[UIColor 颜色]];;
    self.navigationController.navigationBar.barStyle = UIStatusBarStyleDefault;
//设置当前导航条返回按钮颜色
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
//设置导航条标题大小及颜色
self.navigationItem.title = @"余额";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor],
                                                                      NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:17]}];

//设置导航条透明
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
    [self.navigationController.navigationBar setShadowImage:nil];
}

 

特别声明:文章多为网络转载,资源使用一般不提供任何帮助,特殊资源除外,如有侵权请联系!
技术狗 » iOS设置导航条颜色及按钮颜色大小