iOS-修改导航栏文字字体和颜色

 //修改导航栏文字字体和颜色
 nav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[RGBColor colorWithHexString:@"#4b95f2"],NSFontAttributeName:[UIFont boldSystemFontOfSize:20]};
    //修改导航栏颜色
 [[UINavigationBar appearance]setBarTintColor:[RGBColor colorWithHexString:@"#00E5EE"]];
时间: 2024-08-02 10:57:46

iOS-修改导航栏文字字体和颜色的相关文章

ios 修改导航栏的颜色

UINavigationBar *bar = [UINavigationBar appearance]; [bar setBarTintColor:[UIColor blueColor]]; // 修改导航栏的颜色为蓝色 [bar setBarStyle:UIBarStyleBlack]; [bar setTintColor:[UIColor whiteColor]]; // 字体的颜色为白色 [bar setTranslucent:NO];

导航栏上字体与图标的颜色设置

//导航栏上背景色  self.navigationController.navigationBar.barTintColor = RGB(117, 178, 240); //导航栏上自己添加的控件的颜色     self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; //导航栏上字体的颜色     self.navigationController.navigationBar.titleTextAttr

ios UINavigationController 导航栏

1.关于导航栏左右两边的按钮 1.隐藏导航栏上的返回字体 //Swift UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(0, -60), forBarMetrics: .Default) //OC [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarM

ios开发之Swift标签栏按钮UITabBarItem样式修改(图标文字尺寸,颜色等)

UITabBarItem在开发中非常的常用了它可以用来设置字体颜色及图片的设置等等,下面我们来看一篇关于ios开发之Swift标签栏按钮UITabBarItem样式修改(图标文字尺寸,颜色等)的例子,具体的细节如下所示. 1,tabBarItem图片的推荐尺寸和最大支持尺寸 下面是标签栏(UITabBar)中tab按钮图标分别在1x.2x.3x下不会压缩变形的尺寸: @1x : 推荐 25 x 25   (最大: 48 x 32)@2x : 推荐 50 x 50   (最大: 96 x 64)@

iOS 为导航栏自定义按钮图案Button Image 运行出来的颜色与原本颜色不一样 -解决方案

为相机制作闪光灯,在导航栏自定义了"闪光"图案,希望点击时变换图片,但是一直没有改变,原来是因为设置了Global Tint的颜色,所以系统会自动把图片的颜色改为Global Tint的颜色. 解决方案,设置图片时,添加:imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal 源码: - (void) setFlashOn:(BOOL)isOn { if (self.captureDevice.hasFlash) { UIIm

iOS 修改toolbar里面文字的字体和大小

使用NSDictionaty来设置文本的属性: NSDictionary * attributes = @{NSFontAttributeName: [UIFont fontWithName:@"Heiti SC" size:20]}; [confirmBarButton setTitleTextAttributes:attributes forState:UIControlStateNormal]; 完整代码: self.inputToolbar = [[UIToolbar allo

iOS中修改导航栏高度

有时候需要修改导航栏的高度,可以这样修改: UINavigationBar *bar = [self.navigationController navigationBar]; CGFloat navBarHeight = 30.0f; CGRect rect = CGRectMake(0, 20, self.window.frame.size.width, navBarHeight); [bar setFrame:rect];

【转】【iOS】导航栏那些事儿

原文网址:http://www.jianshu.com/p/f797793d683f 参考文章 navigationItem UINavigationItem UINavigationBar UIBarButtonItem UIButton iOS 7 教程:定制iOS 7中的导航栏和状态栏 前言 本文试图阐释清楚导航栏相关的概念和用法,比如UINavigationBar和UINavigationItem的区别和联系,UIBarButtonItem的用法以及在纯代码和storyboard中有什么

iOS 自定义导航栏笔记

一.UINavigationBar的结构 导航栏几乎是每个页面都会碰到的问题,一般两种处理方式:1.隐藏掉不显示 2.自定义 1. 添加导航栏 TestViewController * mainVC = [[TestViewController alloc] init]; UINavigationController * nav = [[UINavigationController alloc] initWithRootViewController:mainVC]; self.window.ro