博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UINavigationController 导航控制器
阅读量:7103 次
发布时间:2019-06-28

本文共 1212 字,大约阅读时间需要 4 分钟。

设置通用的NavagationController

/** * 当第一次使用这个类的时候会调用一次 */+ (void)initialize{    // 当导航栏用在XMGNavigationController中, appearance设置才会生效//    UINavigationBar *bar = [UINavigationBar appearanceWhenContainedIn:[self class], nil];//设置通用的bar    UINavigationBar *bar = [UINavigationBar appearance];    [bar setBackgroundImage:[UIImage imageNamed:@"navigationbarBackgroundWhite"] forBarMetrics:UIBarMetricsDefault];//设置bar中字体的大小    [bar setTitleTextAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:20]}];        // 设置item    UIBarButtonItem *item = [UIBarButtonItem appearance];    // UIControlStateNormal    NSMutableDictionary *itemAttrs = [NSMutableDictionary dictionary];    itemAttrs[NSForegroundColorAttributeName] = [UIColor blackColor];    itemAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:17];    [item setTitleTextAttributes:itemAttrs forState:UIControlStateNormal];    // UIControlStateDisabled    NSMutableDictionary *itemDisabledAttrs = [NSMutableDictionary dictionary];    itemDisabledAttrs[NSForegroundColorAttributeName] = [UIColor lightGrayColor];    [item setTitleTextAttributes:itemDisabledAttrs forState:UIControlStateDisabled];}复制代码

转载于:https://juejin.im/post/5a310076f265da4319564479

你可能感兴趣的文章
屏蔽Chrome(webkit)中的input、textarea的默认点击/聚焦高亮的样式
查看>>
tar安装包,linux 配置jdk1.7 按照步骤做就行
查看>>
初试刀 浅谈Java和C#在面向对象上语法的区别
查看>>
qmake中使用 pkgconfig
查看>>
mongo 数据备份与恢复
查看>>
表单验证(bootstrapValidator)
查看>>
关于反爬虫和恶意攻击的一些策略和思路
查看>>
常用u-boot命令详解(全) .
查看>>
算法导论——二叉查找树
查看>>
LifecycleMBeanBase
查看>>
转载:AbstractQueuedSynchronizer的实现分析(下)
查看>>
Spring IDE 添加xml文件
查看>>
“三缺一”微信谈判猜想 运营商毫无“底牌”
查看>>
base64 加密解密 golang (转)
查看>>
E: Could not get lock /var/lib/dpkg/lock
查看>>
Linux-Java线上故障排查一(高cpu使用率)
查看>>
MySQL的内部XA事务
查看>>
vi 常用命令行
查看>>
优酷去掉广告代码
查看>>
iptables简单设置
查看>>