- (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. UICollectionViewCell 网格显示数据

    using System; using System.Collections.Generic; using Foundation; using UIKit; namespace ddd { publi ...

  2. 关于php编程的一些小技巧

    1. NULL,0和空的区分判断 (1)0与空的区分 <?php  $a = 0;if($a==''){ echo '此判断条件不能区分';}else{ echo '此判断条件可以区分';} ? ...

  3. Linux下Nginx负载 iis问题

    使用以下NGINX配置负载IIS upstream 192.168.119.128{ server 192.168.119.1:8081; server 192.168.119.1:8082; } s ...

  4. phpcms首页实现轮播图

    1.在你想要加轮播图的位置加入以下 <div id="flowDiagram" > <div id="button"> <span ...

  5. Linux下oracle数据库启动和关闭操作

    第一步:登陆 root登陆之后切换到oracle用户上,输入 su oracle 第二步:连接 在oracle用户下,输入 sqlplus /nolog 第三步:使用管理员权限 输入 connect ...

  6. 基于ASP.NET MVC(C#)和Quartz.Net组件实现的定时执行任务调度

    http://www.cnblogs.com/bobositlife/p/aspnet-mvc-csharp-quartz-net-timer-task-scheduler.html 在之前的文章&l ...

  7. wikioi 1166 矩阵取数游戏

    这题做了至少5个小时= =,虽然思路一开始就确定了,但是因为一些错误,比如dp公式里的+打成*,状态未初始化等原因调了好久(>_<) 最后还是参照着别人的解题报告找到错误. 大数模板直接拿 ...

  8. 查询EBS中LOV的SQL语句

    1.帮助->关于:查找会话 SID : 507: 2.点一下LOV右边的三点,触发LOV事件: 3.运行如下代码段: DECLARE  l_sid NUMBER := :SID;BEGIN  F ...

  9. LPC1768\1769之中断优先级与中断优先级组

    一.背景 USB在持续通信几十万次后,会出现USB IN中断丢失几次的情况,分析是中断优先级不够高,导 致USB中断在排队,然而排队还未完成,又有新的USB中断发生,致使其中断丢失.LPC1769的所 ...

  10. mysql 语法

    -create database database_name; show databases;show tables;                                 | -creat ...