使用系统UITabbarItem自定义图片显示原本颜色和自定义文字颜色
。。。。。。
ThirdViewController *thirdVC = [[ThirdViewControlleralloc]initWithTitle:@"搜索信息"];
//设置tabbarItem 的图片显示原图颜色;
thirdVC.tabBarItem = [[UITabBarItemalloc]initWithTitle:@"搜索"image:[[UIImageimageNamed:@"login_usernick"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImageimageNamed:@"login_usernick_highlighted"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
//一句话改变图片和文字的颜色均为红色选中时候
// [[UITabBar appearance]setTintColor:[UIColor redColor]];
//只是设置TabBarItem的字体颜色
[[UITabBarItemappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObject:[UIColorblackColor] forKey:NSForegroundColorAttributeName] forState:UIControlStateNormal];
[[UITabBarItemappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObject:[UIColorredColor] forKey:NSForegroundColorAttributeName] forState:UIControlStateSelected];
RootNavgationController*nav3 = [[RootNavgationControlleralloc]initWithRootViewController:thirdVC];
NSArray *VCs= [NSArray arrayWithObjects:nav1,nav2,nav3, nil];
tabControl.viewControllers = VCs;
self.window.rootViewController = tabControl;
使用系统UITabbarItem自定义图片显示原本颜色和自定义文字颜色的更多相关文章
- css3实现背景颜色渐变,文字颜色渐变,边框颜色渐变
css3的渐变可以使用2个或者多个指定的颜色之间显示平稳的过渡的效果.这篇文章主要介绍下css3实现背景颜色渐变,文字颜色渐变,边框颜色渐变的方法,以便大家学习参考! 1.css背景颜色渐变 代码: ...
- css只改变input输入框光标颜色不改变文字颜色实现方法
input:focus{color:blue}//光标颜色 input{ text-shadow: 0px 0px 0px red;//文字颜色 -webkit-text-fill-color: tr ...
- mui 访问系统相册将图片显示到网页
访问系统相返回值为一个对象,通过转换为字符串可以查看,path.files[0]为返回路径去除路径赋值到src 调用摄像头返回的相片的path为一个路径通过 plus.io.resolveLocalF ...
- IOS实现UIButton图文混排、自定义按钮按下和正常状态下不同的背景颜色、根据文字长度自定义UIButton长度
在一些项目中,我们需要自定义自己的UIButton,使Button上面同时具有图片和文字描述,实现自定义UIButton的图文混排. 首先我们需要定义一个继承自UIButton的类,同时实现自己的in ...
- php 图片合成时文字颜色丢失
最近在做图片合成的时候无意间发现文字颜色丢失了,仔细找了以后才发现原来是因为图片格式的原因 当图片是png图片时文字的颜色就变成了白色的,So.........去你妹的png,用jpg吧! $dest ...
- UITabBar实现自定义背景及UITabBarItem自定义图片和字体
UITabBarItem *firstItem = [[UITabBarItem alloc]initWithTitle:]; //设置字体颜色(后面设置字体状态)(UITextAttributeTe ...
- Java乔晓松-android中调用系统拍照功能并显示拍照的图片
android中调用系统拍照功能并显示拍照的图片 如果你是拍照完,利用onActivityResult获取data数据,把data数据转换成Bitmap数据,这样获取到的图片,是拍照的照片的缩略图 代 ...
- [翻译] MCProgressView 使用自定义图片做进度显示
MCProgressView 使用自定义图片做进度显示 https://github.com/Baglan/MCProgressView Progress bar view with custom i ...
- dedecms织梦系统后台验证码图片不显示的解决方法
网站迁移后,dedecms织梦系统后台验证码图片不显示的解决方法通用解决方案-取消后台验证码功能因为没有验证码,不能进后台,所以修改php文件源代码:方法一:打开dede/login.php 找到如下 ...
随机推荐
- Windows Kernel Security Training Courses
http://www.codemachine.com/courses.html#kerdbg Windows Kernel Internals for Security Researchers Thi ...
- Unix Linux 编程书籍
UNIX环境高级编程(第3版) Advanced Programming in the UNIX Environment Linux/UNIX系统编程手册 Linux/UNIX系统编程手册 (豆瓣) ...
- 在windows系统上安装caffe
下载编译 0.确认电脑上有VS2013 0.确认显卡GPU Compute Capability>=3.0 1.安装CUDA7.5 2.下载cuDNN v4,添加到CUDA7.5 3.根据htt ...
- Goal driven performance optimization
When your goal is to optimize application performance it is very important to understand what goal d ...
- openssh
http://www.openssh.com/ OpenSSH is a FREE version of the SSH connectivity tools that technical users ...
- 禁用 BootStrap Modal 点击空白时自动关闭
方法如下 $('#myModal').modal({backdrop: 'static', keyboard: false}); 这样就可以了, backdrop 为 static 时,点击模态对话框 ...
- mysql sys table
本文详细地介绍了MySQL 5.7新引入的sys schema.首先,本文概要地介绍了sys schema的作用和定位:其次,分别介绍了sys schema中的视图.函数和存储过程:接下来,通过两个例 ...
- oracle的listener.ora sqlnet.ora tnsnames.ora三个文件的关联性
学习:http://www.cnblogs.com/william-lee/archive/2010/10/20/1856261.html 之前因为安装的是windows server 2008 r2 ...
- Phonegap通过JS访问本地接口的两种方法
Phonegap为跨设备的应用开发提供了一个解决方案.如果某个应用只有js和html,则可以通过Phonegap的在线build工具,编译出多个平台的app安装包.当然通过Phonegap提供的js可 ...
- OpenCV图像处理篇之边缘检测算子
OpenCV图像处理篇之边缘检测算子 转载: http://xiahouzuoxin.github.io/notes/ 3种边缘检测算子 一阶导数的梯度算子 高斯拉普拉斯算子 Canny算子 Open ...