博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
通过appearance设置app主题
阅读量:4520 次
发布时间:2019-06-08

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

 

参考资料

oschina源码

TintColor解析

oschina源码分析

//再plist文件中设置View controller-based status bar appearance 为 NO才能起效    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];    //导航条上标题的颜色    NSDictionary *navbarTitleTextAttributes = @{ NSForegroundColorAttributeName:[UIColor whiteColor]}; [[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes]; //导航条上UIBarButtonItem颜色 [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; //TabBar选中图标的颜色,默认是蓝色 [[UITabBar appearance] setTintColor:[UIColor colorWithHex:0x15A230]]; //TabBarItem选中的颜色 [[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor colorWithHex:0x15A230]} forState:UIControlStateSelected]; //导航条的背景颜色 [[UINavigationBar appearance] setBarTintColor:[UIColor navigationbarColor]]; //TabBar的背景颜色 [[UITabBar appearance] setBarTintColor:[UIColor titleBarColor]]; [UISearchBar appearance].tintColor = [UIColor redColor]; //当某个class被包含在另外一个class内时,才修改外观。 [[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setCornerRadius:14.0]; [[UITextField appearanceWhenContainedIn:[UISearchBar class], nil] setAlpha:0.6]; UIPageControl *pageControl = [UIPageControl appearance]; pageControl.pageIndicatorTintColor = [UIColor colorWithHex:0xDCDCDC]; pageControl.currentPageIndicatorTintColor = [UIColor grayColor]; [[UITextField appearance] setTintColor:[UIColor nameColor]]; [[UITextView appearance] setTintColor:[UIColor nameColor]];

转载于:https://www.cnblogs.com/LDSmallCat/p/5143146.html

你可能感兴趣的文章
Cocoa编程开发者手册
查看>>
C++框架_之Qt的开始部分_概述_安装_创建项目_快捷键等一系列注意细节
查看>>
html5基础学习
查看>>
理工之 A+B Problem III
查看>>
SalesForce自定义按钮(javascript执行),点击按钮更新Filed
查看>>
Android中ViewPager实现滑动条及与Fragment结合的实例教程
查看>>
组织过程资产与事业环境因素
查看>>
学习和思考的要点
查看>>
java问题解读,String类为什么是final的
查看>>
JavaWeb项目用浏览器打开网页出现Session Error提示的解决办法
查看>>
软件工程第一次作业
查看>>
(41)zabbix监控api接口性能及可用性 天气预报api为例
查看>>
【Android 界面效果24】Intent和PendingIntent的区别
查看>>
node学习之搭建服务器并加装静态资源
查看>>
android 按menu键解锁功能的开关
查看>>
wpf 自定义窗口,最大化时覆盖任务栏解决方案
查看>>
Linux 下的dd命令使用详解
查看>>
POJ-1273 Drainage Ditches 最大流Dinic
查看>>
ASP.NET学习记录点滴
查看>>
uva 12097(二分)
查看>>