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

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

  

时间: 2024-08-05 11:09:52

设置导航栏标题颜色及字体大小的相关文章

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

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

设置导航栏标题的文字属性

效果: 源码: UINavigationController+TitleTextAttributes.h 与 UINavigationController+TitleTextAttributes.m // // UINavigationController+TitleTextAttributes.h // NC // // Copyright (c) 2014年 Y.X. All rights reserved. // #import <UIKit/UIKit.h> @class NCTitl

UINavigationController改变UINavigationBar导航条标题颜色跟字体

UINavigationController改变UINavigationBar导航条标题颜色和字体 iOS 5 以后 UINavigationController 可以 改变UINavigationBar导航条标题颜色和字体 [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor colorWithRed:0 green

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

ios开发之自己定义默认生成的导航栏 标题 颜色 返回button

一 改动导航栏颜色    导航栏在哪个页面代码放在那里面 self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:(21.0/255.0) green:(153.0 / 255.0) blue:(224.0 / 255.0) alpha:1];                                                   //定义导航栏颜色 self.navigationItem.t

ios开发之自定义默认生成的导航栏 标题 颜色 返回按钮

一 修改导航栏颜色    导航栏在哪个页面代码放在那里面 self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:(21.0/255.0) green:(153.0 / 255.0) blue:(224.0 / 255.0) alpha:1];                                                   //定义导航栏颜色 self.navigationItem.t

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

在平时开发项目的时候,难免会遇到修改导航栏字体大小和颜色的需求,一般使用自定义视图的方法,其实还存在一种方法. 方法一:(自定义视图的方法,一般人也会采用这样的方式) 就是在导航向上添加一个titleView,可以使用一个label,再设置label的背景颜色透明,字体什么的设置就很简单了. //自定义标题视图 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)]; titleLabel.b

导航栏标题颜色设置

相当出自己刚做开发的时候朋到这个问题时候的解决方案是, 创建一个lable,让导航栏的titleView = lable 改变label的字体颜色,才实现的效果 后来才发现 原来也是有API的,希望能给朋友们带来帮助 self.navigationItem.title = @"hello"; NSDictionary * dic = [NSDictionary dictionaryWithObject:[UIColor orangeColor] forKey:NSForegroundC