状态栏 导航栏 tabbar背景色&字体颜色设置
2016-04-13 14:14
666 查看
状态栏样式设置:ios9后要在info.plist中设置View controller-based status bar appearance==NO,默认是YES,设置后修改状态栏的样式代码才管用,
[[UIApplicationsharedApplication]setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];或在对应的viewcontroller中:
-(UIStatusBarStyle)preferredStatusBarStyle
{
returnUIStatusBarStyleLightContent;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[UINavigationBarappearance]
setBarTintColor:[UIColorblueColor]];//导航栏颜色
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; //导航栏返回按钮(除标题)等其他地方的颜色
[[UINavigationBarappearance]setTitleTextAttributes:@{NSFontAttributeName:[UIFontsystemFontOfSize:20],NSForegroundColorAttributeName:[UIColorredColor]}];//导航栏标题颜色&字体,在对应的viewcontroller中用self.title
= @"测试";
//
[[UITabBarappearance]
setTintColor:[UIColorredColor]];//tabbar选中文字颜色
[[UITabBarappearance]setBarTintColor:[UIColorblueColor]];//整个tabbar的颜色
[[UIApplicationsharedApplication]
setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];//状态栏样式
return YES;
}
[[UIApplicationsharedApplication]setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];或在对应的viewcontroller中:
-(UIStatusBarStyle)preferredStatusBarStyle
{
returnUIStatusBarStyleLightContent;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[UINavigationBarappearance]
setBarTintColor:[UIColorblueColor]];//导航栏颜色
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; //导航栏返回按钮(除标题)等其他地方的颜色
[[UINavigationBarappearance]setTitleTextAttributes:@{NSFontAttributeName:[UIFontsystemFontOfSize:20],NSForegroundColorAttributeName:[UIColorredColor]}];//导航栏标题颜色&字体,在对应的viewcontroller中用self.title
= @"测试";
//
[[UITabBarappearance]
setTintColor:[UIColorredColor]];//tabbar选中文字颜色
[[UITabBarappearance]setBarTintColor:[UIColorblueColor]];//整个tabbar的颜色
[[UIApplicationsharedApplication]
setStatusBarStyle:UIStatusBarStyleLightContentanimated:NO];//状态栏样式
return YES;
}
相关文章推荐
- win7安装mamcache扩展
- 也许是适当的人
- VScleaner.bat
- 蓝桥杯—— 算法训练 完数
- 图的创建、广度优先搜索、深度优先搜索
- java多线程入门学习(二)
- 如斯·如诗
- Mysql命令
- 一切又如从前
- 利用NPOI组件操作Excel-数据库与EXCEl之间的操作
- 学习播
- 专门写给yuki同学
- java double类型运算问题
- Java仿12306图片验证码
- android数据库里的query
- Spring和ThreadLocal
- 如何移动CleanMyMac激活码到另一台Mac上
- Let's Encrypt 正式发布,已经保护 380 万个域名
- hadoop文件夹上传问题
- 表单验证插件jQuery.validate 介绍+快速入门案例