iOS设置图片名称、启动图片、防止TabBar图片和文字渲染
2017-02-08 11:00
393 查看
设置App的名称
设置App的启动图片
需要注意点是,App要杀掉重启才能显示出启动图片
2种方法防止图片被渲染
1.vc02.tabBarItem.image=[UIImageimageNamed:@"tabBar_new_icon"]; UIImage*image=[UIImageimageNamed:@"tabBar_new_click_icon"]; image=[imageimageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; vc02.tabBarItem.selectedImage=image;
2.
文字被渲染解决方法
1.vc02.tabBarItem.title=@"新帖"; NSMutableDictionary*attrs=[NSMutableDictionarydictionary]; attrs[NSForegroundColorAttributeName]=[UIColorgrayColor]; [vc02.tabBarItemsetTitleTextAttributes:attrsforState:UIControlStateNormal]; NSMutableDictionary*attrs1=[NSMutableDictionarydictionary]; attrs1[NSForegroundColorAttributeName]=[UIColorblackColor]; [vc02.tabBarItemsetTitleTextAttributes:attrs1forState:UIControlStateSelected];
2.
通过appearance统一设置所有UITabBarItem的文字属性
后面带有UI_APPEARANCE_SELECTOR的方法,都可以通过appearance对象来统一设置
NSMutableDictionary*dic=[NSMutableDictionarydictionary]; dic[NSForegroundColorAttributeName]=[UIColorgrayColor]; NSMutableDictionary*selectedDic=[NSMutableDictionarydictionary]; selectedDic[NSForegroundColorAttributeName]=[UIColordarkGrayColor]; UITabBarItem*item=[UITabBarItemappearance]; [itemsetTitleTextAttributes:dicforState:UIControlStateNormal]; [itemsetTitleTextAttributes:selectedDicforState:UIControlStateSelected];
相关文章推荐
- iOS TabbarController 设置底部Toolbar图片和文字颜色选中样式
- iOS设置tabBarItem.image图片渲染模式
- iOS开发中的错误整理,启动图片设置了没有效果;单独创建xib需要注意的事项;图片取消系统渲染的快捷方式
- ios 开发中,如何设置 uitabbar 里面 tabbaritem 不显示文字,只显示图片,图片垂直居中?
- 用系统的TabBar不让系统渲染图片设置文字背影颜色
- 【iOS开发】设置TabBarItem上文字跟图片一样的颜色
- iOS更改tabbar图片渲染 —不让tabbat有蓝色的渲染 并修改文字
- iOS设置图片圆角--防止离屏渲染
- IOS开发之UIButton同时设置图片文字以及触发按钮时文字图片的切换
- iOS - UIButton设置图片文字上图下文排列
- ios中对于tabBar选中图片设置的问题
- iOS LaunchScreen设置启动图片 启动页停留时间
- iOS App设置icon,启动图,App名称的方法
- 【IOS学习】CoreText学习笔记(二)设置文字属性和插入图片
- 关于iOS 6.0 以后设置UITextField的左侧图片、文字居中(占位符的位置)
- IOS 类似聊天框自动适应文字背景图片的设置
- ios 如何设置启动图片LaunchImage
- iOS按钮设置图片在上文字在下
- iOS Button 上文字图片位置的设置
- IOS设置导航栏全局的背景图片、导航栏title文字颜色大小、导航栏左右按钮的颜色。