zoukankan      html  css  js  c++  java
  • iOS设置导航与其标题的颜色及字体大小和系统默认TabBar的相关设置与使用方法

    第一步:

    //在info.plist中添加一个字段:view controller -base status bar 设置为NO;
    //导航颜色
    [[UINavigationBar appearance] setBarTintColor:[UIColor XXXX]];
    [[UITableViewCell appearance] setBackgroundColor:[UIColor XXXX]];
    
    //设置状态栏(信号区)白色
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
    
    //默认带有一定透明效果,可以使用以下方法去除系统效果
    [navigationController.navigationBar setTranslucent:NO];
    
    //更改导航标题字体大小与颜色要在第一级页面设置 如下
    // 设置导航默认标题的颜色及字体大小
    self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor: [UIColor whiteColor], UITextAttributeFont:[UIFont boldSystemFontOfSize:18]};
    

    第二步:

    //UIImageRenderingModeAlwaysOriginal 让图片表现的模式为图片的原始样式 用于去掉系统添加的颜色
    self.tabBarController.tabBarItem.title = @"title";
    if ([[UIDevice currentDevice] systemVersion].floatValue >= 7.0) {
    
    [self.tabBarController.tabBarItem setFinishedSelectedImage:[[UIImage imageNamed:@"Image.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] withFinishedUnselectedImage:[[UIImage imageNamed:@"ImageS.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    }else{
    [self.tabBarController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"Image.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"ImageS.png"]];
    }
    //tabbar颜色 用于更改字体颜色
    [self.tabBarController.tabBar setTintColor:[UIColor XXXX]];
    

     Demo地址:

    https://github.com/wly314/HappyTravel

    欢迎交流。

  • 相关阅读:
    day01_02.php的开发环境准备
    day01_01.了解php
    day05_01 鸡汤+内容回顾
    河北省科技信息通用调查系统需求-----------开发日志---第一天
    开发项目注意事项总结
    JavaScript学习心得
    掌握需求过程读后感
    自我检讨
    安卓开发使用get请求想服务器发送数据
    对安卓移动应用开发的学习
  • 原文地址:https://www.cnblogs.com/wly314/p/4397527.html
Copyright © 2011-2022 走看看