- (void)addChildViewController:(UIViewController *)ViewController image:(UIImage *)image selectImg:(UIImage *)selectImg title:(NSString *)title navTitle:(NSString *)navTitle{

// 设置navigationBarItem 和 tabBarItem

ViewController.title = title;

// 关键代码 将系统的tabBar的title上调

[ViewController.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -3)];

ViewController.tabBarItem.image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

ViewController.tabBarItem.selectedImage = [selectImg imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

// 设置tabBarItem title样式

[ViewController.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor grayColor]} forState:UIControlStateNormal];

[ViewController.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]} forState:UIControlStateSelected];

// 添加导航栏

UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:ViewController];

ViewController.navigationItem.title = navTitle;

[self addChildViewController:navigation];

}

项目中 -- 设置tabBar样式 (旅游局)的更多相关文章

  1. 在vue项目中设置BASE_URL

    在vue项目中设置BASE_URL 1.在config文件夹中新建global.js文件 const BASE_URL = 'http://192.168.1.62:8080/rest/' expor ...

  2. 记一次项目中的css样式复用

    本文同步至微信公众号:http://mp.weixin.qq.com/s?__biz=MzAxMzgwNDU3Mg==&mid=401616238&idx=1&sn=3c6e9 ...

  3. android 项目中设置背景图片

    xml文件设置背景图片中:任意一个控件,button imageView 或layout,在其的xml属性设置中,添加 [XML] view plaincopy android:background= ...

  4. Django 项目中设置缓存

    一.配置文件settings.py中 # 设置django缓存存放位置为redis数据库,并设置一个默认(default)选项,在redis中(配置文件/etc/redis/redis.conf)开启 ...

  5. vue项目中设置全局引入scss,使每个组件都可以使用变量

    在Vue项目中使用scss,如果写了一套完整的有变量的scss文件.那么就需要全局引入,这样在每个组件中使用. 可以在mian.js全局引入,下面是使用方法. 1: 安装node-sass.sass- ...

  6. web项目中设置首页

    1.在web.xml中设置以下代码: <welcome-file-list> <welcome-file>login.jsp</welcome-file> < ...

  7. 【小程序】小程序中设置 tabBar

    小程序中 tabBar 的设置,tabBar 就是底部导航栏,在app.json中配置. list 为数组至少两项.tab栏的 position 为 top 时间,不显示图标. "tabBa ...

  8. vue uni-app项目中的tabbar

    由于公司要求开发百度小程序,所以我们采用uni-app开发的方式,一套代码多个小程序都可以用,在开发小程序的时候我们也经常会使用到tabbar.当然自己写出来也是不错的.这个就来介绍uni-app中的 ...

  9. CSS中设置字体样式

    <style type="text/css"> body{ font-family: SimHei,"微软雅黑",sans-serif; } < ...

随机推荐

  1. linux系统下使用xampp 丢失mysql root密码【xampp的初始密码为空】

    如果在ubuntu 下面 使用xampp这个集成开发环境,却忘记mysql密码. 注:刚安装好的xampp的Mysql初始密码是空... 找回密码的步骤如下: 1.停止mysql服务器 sudo /o ...

  2. Spring MVC学习笔记——返回JSON对象

    1.想要GET请求返回JSON对象,首先需要导入jackson-all-1.9.4.jar包 2.在控制器中添加不同的show()方法 //show()方法返回JSON对象 @RequestMappi ...

  3. centos 7.0 安装nginx 1.9.10

    可以参考以前安装成功的案例 centos 7.0 nginx 1.7.9成功安装过程 官网下载 http://nginx.org/en/download.html nginx下载位置 /usr/loc ...

  4. 百度编辑器ueditor插入表格没有边框颜色的解决方法

    附:从word excel 中 复制的表格提交后无边框,参考这个同学的,写的很详细:   http://blog.csdn.net/lovelyelfpop/article/details/51678 ...

  5. 什么是License

    许多混乱就始于你不知道License到底是什么,到底有什么含义.当你对你的产品使用License时,并不意味着你放弃了任何权利,你依然对其拥有原著作权.License只是授予他们于特定权利来使用你的产 ...

  6. 【04-10】java中的路径

    java中的路径 System.getProperty("user.dir")  获取工程的绝对路径 Class.class.getClass().getResource(&quo ...

  7. 转→js数组遍历 千万不要使用for...in...

    看到一篇内容还不错,但是排版实在糟糕, 逼死强迫症患者啊,直接拉下去找原文连接,找到了,但是已经消失了···500错误... 第一次因为实在看不下去一篇博客的排版, 为了排版而转载... 转载地址:h ...

  8. Cheat sheets

  9. jq绑定事件的4种方式

    jQuery提供了多种绑定事件的方式,每种方式各有其特点,明白了它们之间的异同点,有助于我们在写代码的时候进行正确的选择,从而写出优雅而容易维护的代码.下面我们来看下jQuery中绑定事件的方式都有哪 ...

  10. 在SQL中 给字符串补0方法

    --第一种方法SELECT RIGHT('00000'+CAST(ID AS nvarchar(50)),5) FROM dbo.TableName --左边补0,如 00001,00039 SELE ...