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 ...
随机推荐
- 求1到n,n个整数的全排列
package com.dong.harder; public class AllArrays { public static void main(String[] args) { // TODO A ...
- sass 的安装 http://blog.csdn.net/weixin_38362146/article/details/78035971?locationNum=10&fps=1
http://blog.csdn.net/weixin_38362146/article/details/78035971?locationNum=10&fps=1
- table tr 加入背景色之后 去掉td之间的空隙
给table加样式 border-collapse:collapse;
- 04_web基础(一)之tomcat介绍
01.web引入 在这之前我们已经能够在数据库进行CRUD,在dao处进行CRUD,在service处进行CRUD,对用户来说必须在浏览器上进行CRUD,要完成这个就必须具备web知识. 而web运行 ...
- JMeter学习(二十六)逻辑控制器(转载)
转载自 http://www.cnblogs.com/yangxia-test JMeter中的Logic Controller用于为Test Plan中的节点添加逻辑控制器. JMeter中的Log ...
- eCharts 折线图,动态绑定数据不更新图表的问题,
官方文档 : http://echarts.baidu.com/tutorial.html npm install echarts --save let lineChart = echarts.ini ...
- Floyd算法简介
参考:https://blog.csdn.net/qq_35644234/article/details/60875818 一.Floyd算法的介绍 1.算法的特点: 弗洛伊德算法是解决任 ...
- centos openvpn 安装
安装环境: 系统:centos 6.5 openvpn:openvpn-2.2.1 lzo:lzo-2.09 下载地址:http://www.oberhumer.com/opensource/l ...
- PHP遍历数组常用方式(for,foreach,while,指针等等)
1使用for循环遍历数组 count($arr)用于统计数组元素个数 for循环只能用于遍历,纯索引数组!!如果存在关联数组,count统计两种数组的总个数 使用for ...
- 快速了解和使用Photon Server
https://blog.csdn.net/qq_36565626/article/details/78710787