在controller里面设置导航栏的颜色及左右中

[self.navigationController.navigationBar setBarTintColor:[UIColor purpleColor]];

或者如下,图片高度应该为64像素

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navi_bg"] forBarMetrics:UIBarMetricsDefault];

自定义UINavigationController,很好

https://yq.aliyun.com/articles/31390

时间: 2024-08-08 14:17:28

在controller里面设置导航栏的颜色及左右中的相关文章

iOS 设置导航栏之二(设置导航栏的颜色、文字的颜色、左边按钮的文字及颜色)

                  #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end #import "AppDelegate.h" #import "KeyViewController.h" @interface Ap

iOS 设置导航栏的颜色和导航栏上文字的颜色

#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end #import "AppDelegate.h" #import "KeyViewController.h" @interface AppDelegate () @end

设置导航栏标题颜色及字体大小

//改变导航栏标题颜色及字体大小 e.g设置字体颜色为red 字体大小为18 self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor redColor], NSFontAttributeName : [UIFont boldSystemFontOfSize:18]}; //改变导航栏返回按钮颜色 [self.navigationControll

iOS-笔记 设置导航栏的样式

//设置导航栏字体及颜色 [self.navigationController.navigationBar setTitleTextAttributes: @{NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:[UIColor whiteColor]}]; //设置导航栏背景颜色 self.navigationController.navigationBar.barTintColor

iOS设置导航栏样式(UINavigationController)

//设置导航栏baritem和返回baiitem样式 UIBarButtonItem *barItem = [UIBarButtonItem appearance]; //去掉返回按钮上的字 [barItem setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault]; //把按钮设置为白色 barItem.tintColor = [UIColor whiteColor]

iOS 更改导航栏背景颜色

ios7以下的版本设置导航栏背景颜色可以使用 [[UINavigationBar appearance] setTintColor:[UIColor orangeColor]]; ios7以后: [[UINavigationBar appearance] setBarTintColor:[UIColor orangeColor]]; 默认带有一定透明效果,可以使用以下方法去除系统效果 [navigationController.navigationBar setTranslucent:NO];

【转】iOS中设置导航栏标题的字体颜色和大小

原文网址:http://www.360doc.com/content/15/0417/11/20919452_463847404.shtml iOS中设置导航栏标题的字体颜色和大小,有需要的朋友可以参考下. 在平时开发项目的时候,难免会遇到修改导航栏字体大小和颜色的需求,一般使用自定义视图的方法,其实还存在一种方法. 方法一:(自定义视图的方法,一般人也会采用这样的方式) 就是在导航向上添加一个titleView,可以使用一个label,再设置label的背景颜色透明,字体什么的设置就很简单了.

统一设置导航栏的皮肤颜色

+ (void)initialize{ UINavigationBar *bar = [UINavigationBar appearance]; //    [self buttonImageFromColor:[UIColor blackColor]] UIImage *image = [UIImage imageNamed:@"img_nav_topbar"]; [bar setBackgroundImage:image forBarMetrics:UIBarMetricsDefa

设置导航栏的背景颜色的分类

 这是设置导航栏的背景颜色的分类