当前位置:网站首页>Sina Weibo client (4) - set navigation bar theme
Sina Weibo client (4) - set navigation bar theme
2022-07-25 08:40:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
In order to make the whole project NavigationBar Upper UIBarButtonItem The color of the , Consistent font size , Navigation bar needs to be set The theme .
Because the project uses custom DJNavigationController, And ensure that it is set only once , So write the code to set the theme in DJNavigationController.m In the document initialize In the method .
DJNavigationController.m
#import "DJNavigationController.h"
@implementation DJNavigationController
+ (void)initialize {
UIBarButtonItem *btnItem = [UIBarButtonItem appearance];
// Set up current item Available status
NSMutableDictionary *normalAttr = [NSMutableDictionary dictionary];
// Set the foreground
normalAttr[NSForegroundColorAttributeName] = [UIColor orangeColor];
// Set current font size
normalAttr[NSFontAttributeName] = [UIFont systemFontOfSize:14];
[btnItem setTitleTextAttributes:normalAttr forState:UIControlStateNormal];
// Set up current item Unavailable status
NSMutableDictionary *disableAttr = [NSMutableDictionary dictionary];
disableAttr[NSForegroundColorAttributeName] = [UIColor grayColor];
disableAttr[NSFontAttributeName] = [UIFont systemFontOfSize:14];
[btnItem setTitleTextAttributes:disableAttr forState:UIControlStateDisabled];
}Final effect :
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/108839.html Link to the original text :https://javaforall.cn
边栏推荐
- Redis fragment cluster
- Review the second time, 220614, video, day03_ Data warehouse design,
- Database persistence +jdbc database connection
- RTOS系列(13):汇编LDR指令、LDR伪指令、[Rn]寄存器间接引用 详细解析
- 聊下自己转型测试开发的历程
- [dark horse programmer] redis learning notes 005: enterprise level solutions
- PHP reports an error: classes\phpexcel\cell php Line(594) Invalid cell coordinate ESIGN1
- Qt|qlabole change line spacing when displaying multiple lines
- 公寓报修系统(IDEA,SSM,MySQL)
- 这是我见过写得最烂的Controller层代码...
猜你喜欢

游戏外挂怎么做?

QA robot sequencing model

IDEA下依赖冲突解决方法

【无标题】

技术面②Mysql中的索引(index)类型有哪些并简要介绍一下?什么时候需要创建索引?什么时候不需要创建索引?为什么创建索引后查询速度会提高?

Online shopping E-commerce mall system based on jsp+servlet+mysql+

华为设备远程登录(Telnet、SSH)配置

The fifth day of MATLAB learning (cycle type)

【黑马程序员】Redis学习笔记005:企业级解决方案

【黑马程序员】Redis学习笔记002:持久化:RDB 和 AOF
随机推荐
Foundation 31: Selenium positioning dynamic ID element
Wechat reservation applet graduation design of applet completion works (2) applet function
Wechat reservation of small program completion works (5) assignment book of small program graduation project
Online shopping E-commerce mall system based on jsp+servlet+mysql+
QA robot sequencing model
A powerful port scanning tool (nmap)
公寓报修系统(IDEA,SSM,MySQL)
Brush the title "sword finger offer" day01
Wechat applet ordering system graduation design of applet completion works (8) graduation design thesis template
@Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
C#入门系列(三十) -- 异常处理
Graduation project of wechat small program ordering system of small program completion works (7) Interim inspection report
FreeMaker模板引擎
Freemaker template engine
@The difference and use of value and configurationproperties
Force buckle - 1046. Weight of the last stone
Use of lambdaquerywrapper, lambdaupdatewrapper, lambdaquerychainwrapper
Wechat applet ordering system graduation design of applet completion works (2) applet function
[dark horse programmer] redis learning notes 005: enterprise level solutions
聊下自己转型测试开发的历程