- (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. mysql 可以跨库查询

    eg: SELECTcity.ID,city.`Name`,city.CountryCode,city.District,city.Population,adv_site.ADD_DATEFROMci ...

  2. HotSpot JVM常用参数设置

    转自:https://www.zybuluo.com/jewes/note/57352 选项的分类 Hotspot JVM提供以下三大类选项: 1. 标准选项:这类选项的功能是很稳定的,在后续版本中也 ...

  3. css水平垂直居中对齐方式

    1.文字或者内联元素的垂直水平居中对齐 css属性 -- 水平居中:text-aligin:center; 垂直居中: line-height:height; 例子:. html: <div c ...

  4. getElementsByClassName简单实现

    function getElementsByClassName(node, className) { var aClassReg = className.split(' ').map(function ...

  5. 【ueditor】api方法

    //让其选中文本高亮 editor.selection.getRange().select(); //高亮后,才能获取到选中文本,当选中字失去焦点的情况下是获取不到的选中文本的 var text = ...

  6. 设备旋转,创建水平模式布局--Android studio

    1.在项目工具窗口中,右键单击res目录后选择new--Android resource directory菜单项. 2.从资源类型Resource type列表中选择layout,保持Source ...

  7. Maven模块聚合

    一个Maven工程中一般会有很多模块组成,为了构建的方便通常想一次构建多个模块,Maven聚合这一特性就是为该需求服务的. 假设我们有account-email和account-persist两个模块 ...

  8. spark 官方文档(1)——提交应用程序

    Spark版本:1.6.2 spark-submit提供了在所有集群平台提交应用的统一接口,你不需要因为平台的迁移改变配置.Spark支持三种集群:Standalone.Apache Mesos和Ha ...

  9. 3d转换-正方体-Html5Css3-遁地龙卷风

    (-1) 写在前面 我用的是chrome49,这个案例是从网上看到的,向这位同行致敬,建议大家在记录自己学习感悟时,向我一样加上笔名,被转载的时候还能留下点东西. 在研究slice-box.js的时候 ...

  10. Makefile的编写

    makefile介绍 makefile的功能是管理源文件的编译链接,在makefile我们可以定义一系列的规则来指定哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译,甚至于进行更复杂的功能 ...