[分享]iOS开发-设置NavigationBar的颜色和字体属性

news/2024/7/3 10:26:54 标签: 移动开发

代码如下:

#define kColorBarTint   [UIColor colorWithRed:56/255.0 green:170/255.0 blue:27/255.0 alpha:1.0]


#import "SSMyViewController.h"

@interface SSMyViewController ()

@end

@implementation SSMyViewController

-(void)viewDidLoad {
    [super viewDidLoad];
    //set NavigationBar 背景颜色&title 颜色
    [self.navigationController.navigationBar setBarTintColor:kColorBarTint];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:22],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
}

-(void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end

http://www.niftyadmin.cn/n/1152186.html

相关文章

Mqtt(emqx)上下线监听

在mqtt协议中,存在LTW(Last Will and Testament)遗言机制,该机制只能捕捉客户端异常离线的通知,而无法获取正常通过disconnect断开连接的通知。 LTW(Last Will and Testament)遗言机制 客户端在…

vs2010尝试运行项目时出错,无效指针

有些人说是IntelliTrace的原因,但我这项根本就是关闭的, 两个解决方法:1) 打开项目属性,选择调试选项卡,将“启用非托管代码调试”一项钩上。2) 打开项目属性,选择调试选项卡,将“启用Visual Studio宿主进程“一项钩掉…

Mqtt5 - 会话保留与离线消息接收(完整)

最近在做IM(及时通信)相关的应用,长连接(消息收发)采用的Mqtt5,mqtt支持会话保存(cleanStart)、会话超期(sessionExpire)、Qos等设置,可以实现移动…

Go语言中Socket通信TCP服务端

1、用法: (1)定义远程IP地址。使用net.ResolveTCPAddr()方法,定义一个TCP地址,做为本机监听地址。 (2)使用net.ListenTCP("tcp",localAddress)方法开始监听,并返回tcpList…

Mysql字段变更

新增字段 语法:alter table 表名 add 列名 字段类型; 示例: alter table message add message_type tinyint(4); alter table message add message_type tinyint(4) not null comment 消息类型 after message_id; alter table message add column1 int…

C#解leetcode 228. Summary Ranges Easy

Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. 我的代码,结果Accepted,507ms: public class Solution{pu…

Jmeter-【JSON Extractor】-响应结果中一级key取值

一、请求返回样式 二、取code值 三、查看结果 转载于:https://www.cnblogs.com/Nancy-Lee/p/10935768.html

基于redis超时通知的设计

文章目录Redis自带Notifications的局限性常见的超时通知实现结合Redis zSet的定时调度超时通知实现一种zSet的开源实现Redisson DelayedQueue实现Redis自带Notifications的局限性 redis自带expire机制,结合Redis Keyspace Notifications通知机制,可以实…