1.改变UITabBarItem 字体颜色

[[UITabBarItemappearance]setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColorwhiteColor],UITextAttributeTextColor,nil]forState:UIControlStateNormal];

[[UITabBarItemappearance]setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorcolorWithHexString:"#00C8D3"],UITextAttributeTextColor,nil]forState:UIControlStateSelected];

设置tabbarItem选中的颜色为红色

2.改变UITabBarItem 字体颜色和大小

[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor blackColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"Helvetica" size:12.0f],NSFontAttributeName,nil] forState:UIControlStateNormal];

[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, [UIFont fontWithName:@"Helvetica" size:12.0f],NSFontAttributeName,nil] forState:UIControlStateSelected];

设置UITabBarItem 字体颜色和大小

这里需要注意的是在设置字体的时候要选择支持中文的字体,不然的话修改字号是无效的,比如字体设置成“ProximaNova-Semibold”,这种字体本身只支持英语的,不支持中文所以使用该字体并不能调整字体大小

3.改变UITabBarItem的选中和非选中图片

UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:[[ServiceProviderViewController alloc] init]];

nav1.tabBarItem.image = [ImageNamed(@"tabicon1_unselect") imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

nav1.tabBarItem.selectedImage = [ImageNamed(@"tabicon1_select") imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

nav1.tabBarItem.title = @"服务商";

改变UITabBarItem的选中和非选中图片

4.改变UITabBarController的颜色

UIView*mView=[[UIViewalloc]initWithFrame:CGRectMake(0,0,320,48)];//这是整个tabbar的颜色

[mViewsetBackgroundColor:[UIColorcolorWithPatternImage:[UIImageimageNamed:@"tabbar.png"]]];

[tab.tabBarinsertSubview:mViewatIndex:1];

mView.alpha=0.8;

设置UITabBar的颜色

5.如何隐藏系统自带的tabbar

有时候有的页面并不需要显示tabbar,但是返回的时候要显示tabbar,举个例子A->B 当A push到 B 时需要设置self.navigationController.hidesBottomBarWhenPushed= YES;

A页面的设置

同时在B页面要

- (void)viewWillAppear:(BOOL)animated

{

[superviewWillAppear:animated];

self.tabBarController.tabBar.hidden=YES;

}

- (void)viewWillDisappear:(BOOL)animated

{

[superviewWillDisappear:animated];

self.tabBarController.tabBar.hidden=NO;

}

设置进到页面时隐藏,退出页面时不隐藏

iOS开发--一些UITabBarItem属性的设置[转]的更多相关文章

  1. iOS开发之--UITextField属性

    UITextField属性 0.     enablesReturnKeyAutomatically 默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的. ...

  2. 【swift,oc】ios开发中巧用自动布局设置自定义cell的高度

    ios开发中,遇到自定义高度不定的cell的时候,我们通常的做法是抽取一个frame类,在frame类中预算好高度,再返回. 但是苹果出来自动布局之后...春天来了!!来看看怎么巧用自动布局设置自定义 ...

  3. iOS开发-为程序添加应用设置

    一.设置捆绑包 设置捆绑包是应用自带的一组文件,用于告诉设置该应用期望得到用户的哪些偏好设置. 新建设置捆绑包:Command+N,在iOS部分中的Resource,选择Settings Bundle ...

  4. iOS开发(1):设置APP的图标与启动图 | iOS图标的尺寸 | LaunchScreen的使用

    每个APP都应该有自己的图标跟启动图. 这里介绍怎么设置iOS的APP的图标跟启动图. (1)图标 小程的xcode是10.0版本,设置图标的入口如下: 点击入口后,进到设置页面,如下: 可以看到有很 ...

  5. iOS开发-本地存储(偏好设置,Plist,归档)

    1.   NSUserDefaults //TODO: 1.NSUserDefaults NSUserDefaults类除了可以存储数组.字典.NSdata外,还可以直接存储OC基本类型属性.但是不能 ...

  6. iOS开发UIScrollView常见属性和方法

    一.ScrollView常用方法和属性 @property(nonatomic)CGPoint contentOffset; 设置滚动的偏移量 @property(nonatomic)CGSize c ...

  7. iOS开发CATransform3D.h属性详解和方法使用

    1.CATransform3D简介 layer有个属性transform,是CATransform3D类型.可以使其在三维界面作平移.缩放和旋转单独或组合动画! CATransform3D结构体: / ...

  8. iOS开发备忘录:属性列表文件数据持久化

    属性列表文件是一种XML文件,Foundation框架中的数组和字典等都可以于属性列表文件相互转换. NSArray类常用读写属性列表文件的方法: +arrayWithContentsOfFile:类 ...

  9. iOS开发--关于TableViewCell的可视化设置细节

    由于时间问题,本篇博文很简略. 1.关于设置Cell的边距问题

随机推荐

  1. Xcode6.1标准Framework静态库制作方法。工程转Framework,静态库加xib和图片。完美解决方案。

    http://www.cocoachina.com/bbs/read.php?tid-282490.html Xcode6.1标准Framework静态库制作方法.工程转Framework,静态库加x ...

  2. The data is said to include information from networks

    The data is said to include information from networks as well as from individual computers and smart ...

  3. Get IP Address in Android 4.0+

    在android2.3以下的系统中,可以使用如下的代码来获取Android系统的本地IP地址: [java]  private String getLocalIPAddress() throws So ...

  4. python 的 *args 和 **kwargs

    Python支持可变参数,通过*args和**kwargs来指定,示例如下: def test_kwargs(first, *args, **kwargs):    print 'Required a ...

  5. 2014年3月份第3周51Aspx源码发布详情

    WPF翻书效果源码  2014-3-17 [VS2010]源码描述:WPF翻书效果源码:多点触控的一个Demo,利用鼠标可以实现图书翻页效果:适合新手学习研究. TL简单家具网新手源码  2014-3 ...

  6. Python Scopes and Namespaces

    Before introducing classes, I first have to tell you something about Python's scope rules. Class def ...

  7. windows python3.2 shell环境(python叫做解释器)

    [进入python的shell 环境:](python里称作命令解释器,windows叫做cmd,unix叫做shell) cmd  输入set path=%path%;e:\python2.7然后输 ...

  8. Error:(1, 0) Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/9574

    这个一般是因为你打开的项目所在的目录存在中文,把项目换到全英文目录下就没问题了

  9. 02_java语法基础_课程动手动脑问题以及课后实验性问题及解答集锦

    Answer: 动手动脑: 1:1.1--仔细阅读实例:EnumTest.java,运行它,分析运行结果? 1.2--你能得到什么结论?你掌握了枚举变量的基本用法了吗? answer:枚举类型是引用类 ...

  10. Knockoutjs实例 - 属性绑定(Bindings)之流程控制(Control flow)

    一.foreach binding 使用此功能可以方便我们循环遍历输出某个数组.集合中的内容. (1).循环遍历输出数组 View Row Code 1 <script type="t ...