设置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图片和文字渲染的更多相关文章

  1. 【转载】iOS 设置Launch Image 启动图片(适用iOS9)

    Step1 1.点击Image.xcassets 进入图片管理,然后右击,弹出"New Launch Image" 2.如图,右侧的勾选可以让你选择是否要对ipad,横屏,竖屏,以 ...

  2. iOS 设置导航栏的颜色和导航栏上文字的颜色

    #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @pr ...

  3. ios - 设置一个VC的navigationController的显示图案或文字,其他navigationController依旧不变

    1. override func viewDidLoad() { super.viewDidLoad() self.navigationController?.delegate = self } 2. ...

  4. iOS 8 Xcode6 设置Launch Image 启动图片

    本人apem http://www.mamicode.com/info-detail-494411.html 如何设置App的启动图,也就是Launch Image? Step1 1.点击Image. ...

  5. Ios8 Xcode6 设置Launch Image 启动图片

    http://blog.sina.com.cn/s/blog_6c97abf10102voui.html Http://Www.woowen.com/Swift/2014/12/12/Ios8设置La ...

  6. 设置TabBar图片

    设置TabBar图片 // 拿到 TabBar 在拿到想应的item UITabBar *tabBar = _tabBarController.tabBar; UITabBarItem *item0 ...

  7. iOS tabbar 图片,最佳大小方式

    iOS tabbar 图片,最佳大小方式 文档大小 30 *30 retaina 60 *60 最佳大小 48 *32 参考:http://stackoverflow.com/questions/15 ...

  8. 【iOS开发-29】解决方式:TabBar的图片不显示,仅仅显示灰色的正方形

    (1)现象 tabbar上的图片变成一块正方形的灰色块块,原先的图片没有了. (2)原因 tabbar上的图片本质上不是一个图片.而是一个形状图片.系统对我们使用的图片也仅仅是把当中的形状" ...

  9. IOS设置button 图片 文字 上下、左右

    [btn setImage:imgNor forState:UIControlStateNormal]; [btn setImage:imgSel forState:UIControlStateSel ...

随机推荐

  1. Incompatible shapes during the half way training---Invalid argument: Incompatible shapes: [1,63,4] vs. [1,64,4]

    这是tensorflow model 中我使用它的faster--cnn,但是就是训练过程中,代码执行到一半 一般是step=40~120的时候就报错了: INFO:tensorflow:global ...

  2. MPI Maelstrom-单源最短路-Djsktra

    BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distribute ...

  3. 头像修改功能 包含ios旋转图片 但是旋转后没遮罩, 正常图片可以显示遮罩 宽高不规则图片没做控制 遮罩框可以拖动

    https://blog.csdn.net/wk767113154/article/details/77989544  参考资料 <template> <div id="p ...

  4. openstack 资料

    调用流程 https://blog.csdn.net/bill_xiang_/article/details/72909927

  5. 线段树模板(HDU 6356 Glad You Came)

    题目: HDU 6356 http://acm.hdu.edu.cn/showproblem.php?pid=6356 很裸的线段树 #include<bits/stdc++.h> #de ...

  6. zookeeper 集群配置采坑 Connection refused WARN [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@584] - Cannot open channel to 3 at election address slave2/192.168.127.133:3888

    坑一: Cannot open channel to at election address slave1/ java.net.ConnectException: Connection refused ...

  7. java.lang.IllegalArgumentException: No Retrofit annotation found. (parameter #1) for method ApiService.getMethod

    @FormUrlEncoded @POST("getMethod") Observable<Bean> getMethod(String field); 今天在写Ret ...

  8. Fiddler抓包域名过滤(转载)

    转载自 http://www.cnblogs.com/111testing/p/6440480.html Fiddler抓包域名过滤 我们在用Fiddler抓包的时候会抓到很多不需要的数据包,我们怎样 ...

  9. appium多机并行测试

    在实际应用中需要对多个机型并行测试,节省时间 多机测试的思路 启动多个appium server与多台机器交互(android和ios均可)   注意:一定要使用node安装appium的命令行,使用 ...

  10. MySQL之多表查询练习 与基本查询基础

    MySQL  增删查改 一.增:有2种方法 1.使用insert插入单行数据: 语法:insert [into]<表名> [列名] values <列值> 例:insert i ...