iOS设置图片名称、启动图片、防止TabBar图片和文字渲染
设置App的名称

设置App的启动图片

需要注意点是,App要杀掉重启才能显示出启动图片
2种方法防止图片被渲染
1.
vc02.tabBarItem.image = [UIImage imageNamed:@"tabBar_new_icon"];
UIImage *image = [UIImage imageNamed:@"tabBar_new_click_icon"];
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
vc02.tabBarItem.selectedImage = image;
2.

文字被渲染解决方法
1.
vc02.tabBarItem.title = @"新帖";
NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
attrs[NSForegroundColorAttributeName] = [UIColor grayColor];
[vc02.tabBarItem setTitleTextAttributes:attrs forState:UIControlStateNormal];
NSMutableDictionary *attrs1 = [NSMutableDictionary dictionary];
attrs1[NSForegroundColorAttributeName] = [UIColor blackColor];
[vc02.tabBarItem setTitleTextAttributes:attrs1 forState:UIControlStateSelected];
2.
- 通过appearance统一设置所有UITabBarItem的文字属性
- 后面带有UI_APPEARANCE_SELECTOR的方法,都可以通过appearance对象来统一设置
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
dic[NSForegroundColorAttributeName] = [UIColor grayColor];
NSMutableDictionary *selectedDic = [NSMutableDictionary dictionary];
selectedDic[NSForegroundColorAttributeName] = [UIColor darkGrayColor];
UITabBarItem *item = [UITabBarItem appearance];
[item setTitleTextAttributes:dic forState:UIControlStateNormal];
[item setTitleTextAttributes:selectedDic forState:UIControlStateSelected];
iOS设置图片名称、启动图片、防止TabBar图片和文字渲染的更多相关文章
- 【转载】iOS 设置Launch Image 启动图片(适用iOS9)
Step1 1.点击Image.xcassets 进入图片管理,然后右击,弹出"New Launch Image" 2.如图,右侧的勾选可以让你选择是否要对ipad,横屏,竖屏,以 ...
- iOS 设置导航栏的颜色和导航栏上文字的颜色
#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @pr ...
- ios - 设置一个VC的navigationController的显示图案或文字,其他navigationController依旧不变
1. override func viewDidLoad() { super.viewDidLoad() self.navigationController?.delegate = self } 2. ...
- iOS 8 Xcode6 设置Launch Image 启动图片
本人apem http://www.mamicode.com/info-detail-494411.html 如何设置App的启动图,也就是Launch Image? Step1 1.点击Image. ...
- Ios8 Xcode6 设置Launch Image 启动图片
http://blog.sina.com.cn/s/blog_6c97abf10102voui.html Http://Www.woowen.com/Swift/2014/12/12/Ios8设置La ...
- 设置TabBar图片
设置TabBar图片 // 拿到 TabBar 在拿到想应的item UITabBar *tabBar = _tabBarController.tabBar; UITabBarItem *item0 ...
- iOS tabbar 图片,最佳大小方式
iOS tabbar 图片,最佳大小方式 文档大小 30 *30 retaina 60 *60 最佳大小 48 *32 参考:http://stackoverflow.com/questions/15 ...
- 【iOS开发-29】解决方式:TabBar的图片不显示,仅仅显示灰色的正方形
(1)现象 tabbar上的图片变成一块正方形的灰色块块,原先的图片没有了. (2)原因 tabbar上的图片本质上不是一个图片.而是一个形状图片.系统对我们使用的图片也仅仅是把当中的形状" ...
- IOS设置button 图片 文字 上下、左右
[btn setImage:imgNor forState:UIControlStateNormal]; [btn setImage:imgSel forState:UIControlStateSel ...
随机推荐
- 本地Navicat连不上Linux虚拟机MySQL数据库问题
LinuxAndMySQL 版权声明:本文为博主原创文章,未经博主允许不得转载. 在Linux登录到MySQL数据:mysql -uroot -p 输入密码 切换到mysql数据库 mysql> ...
- mybatis 插入返回自增后的id
//serviceImpl int customerId = customerDao.insertDynamic(customer1); System.out.println("id==== ...
- Struts学习资料
Strust组件—ActionServlet详解 http://ltc603.iteye.com/blog/68637
- php71
yum -y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd jpegsrc libmcrypt libpng li ...
- SolarWinds网络管理手册列表
前段时间使用过SolarWinds管理思科的交换机,在使用的过程中自己做了一个简单的使用手册,SolarWinds是一款非常强悍的网管软件,手册中没有完全涉及SolarWinds的所有功能,Solar ...
- JS 7路线图
JS 7路线图 今天,我很高兴宣布路线图到视频.JS 7!虽然这是一个主要版本更新,但很少有真正打破.两个主要变化是添加了videojs-http-streaming,简称为VHS,以及删除了对较老版 ...
- 从上往下打印二叉树(python)
题目描述 从上往下打印出二叉树的每个节点,同层节点从左至右打印. # -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # ...
- 第三章 列表(c)有序列表
- e-olymp Problem8352 Taxi
作为我在这个OJ玩了一下午的终结吧. 水题一道,阅读理解OJ. 传送门:点我 Taxi At the peak hour, three taxi buses drove up at the same ...
- vue 打包
1.assetsPublicPath路径改为‘./’(两处) 2.cmd运行 cnpm run build 3.生成的dist文件即可本地访问