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 ...
随机推荐
- vue 巧妙的运用sass px 转 rem
<template> <div id="app"> <!-- <img src="./assets/logo.png"> ...
- mongodb副本集的从库永久性设置setSlaveOk
今天在生产环境下面搭了一个mongo的副本集,但开发那边要求副本集读写分离. 坑爹的是每次上副本集的时候都要设置db.getMongo().setSlaveOk()才能访问数据.感觉很是苦逼. 后来开 ...
- linux系统修改系统时间与时区
有装过Linux系统的人,可能都会有这样的经历,就是该机器安装windows系统时,时间正确,但是安装了linux系统后,尽管时区选择正确,也会发现系统时间不对.这是由于安装系统时采用了UTC,那么什 ...
- Java基础学习笔记(四)
21.构造方法(续):分类: 隐式构造方法:如果在一个类中,没有手动编写构造方法,则系统会提供一个默认的无参的构造方法 显式构造方法:如果在一个类中,手动编写构造方法,则系统不会提供默认的无参的构造方 ...
- poj2970 The lazy programmer 【优先队列】
A new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is ...
- 2018年全国多校算法寒假训练营练习比赛(第四场)F:Call to your teacher
传送门:https://www.nowcoder.net/acm/contest/76/F 题目描述 从实验室出来后,你忽然发现你居然把自己的电脑落在了实验室里,但是实验室的老师已经把大门锁上了.更糟 ...
- Python+Selenium学习--鼠标事件
场景 前景讲解了鼠标的click()事件,而我们在实际的web产品测试中,有关鼠标的操作,不仅仅只有单击,有时候还包括右击,双击,拖动等操作,这些操作包含在ActionChains类中. Action ...
- Jmeter 录制脚本(二)
1)选择WorkBench,右键 Add -> Non-Test Elements -> HTTP(S) Test Script Recorder 2)在HTTP(S) Test Scri ...
- [Java学习]集合
一. Collection与Map继承结构图 Collection继承结构图 实现Collection接口的类只能存储引用类型!所以set.add(10)会有自动装箱的过程,把int 转成 Integ ...
- 865. Smallest Subtree with all the Deepest Nodes 有最深节点的最小子树
[抄题]: Given a binary tree rooted at root, the depth of each node is the shortest distance to the roo ...