##DAY9 UITabBarController

UIViewController的tabBarController

UIViewController的tabBarItem

#pragma mark ———————tabBarItem——————————

UIViewController的tabBarItem属性的属性:

title 设置显示的文本

badgeValue 设置显示的角标

image 设置未点击时的图片

selectedImage 设置被选中的标签栏的图片

注意:这里的图片会受tabBarItem的影响

注意:图片想正常显示,必须是png格式

#pragma mark ———————UITabBarItem——————————

三种创建:

initWithTitle:image:selectedImage:

initWithTabBarSystemItem:tag:

initWithTitle:image:tag:

#pragma mark ———————UITabBarController——————————

UITabBarController和UINavigationController一样都是继承于UIViewController

创建:

init

属性:

viewControllers 数组,设置标签视图控制器需要管理的子视图控制器

selectedIndex 设置标签栏选中的下标

delegate 代理

selectedViewController 设置标签栏选中的视图控制器

tabBar 标签栏

#pragma mark ———————tabBar——————————

tabBar的属性:

<UITabBarDelegate> delegate

items 数组

selectedItem

tintColor

barTintColor

其他见头文件

#pragma mark ——————设置全局外观——————————

//一键换肤

//设置全局外观

//[UITabBar appearance] 找到当前应用的标签栏 UITabBar

//setTintColor: 修改显示的文本的颜色

[[UITabBar appearance] setTintColor:[UIColor greenColor]];

##DAY9 UITabBarController的更多相关文章

  1. UITabBarController 升级定制

    UITabBarController 定制 特点 用法 1.准备工作: 加入你的相关图片,放入了Assets.xcassets; 导入Categroy文件夹(这个里面的文件,在这里不详细说明了,有疑问 ...

  2. UITabBarController 基本定制

    UITabBarController 定制 特点 用法 1.准备好你的tabBar图片及其他图片(哈哈哈!!!!),我的图片都放在了Assets.xcassets中. 2.导入本工程中的Categro ...

  3. 自定义UITabBarController标签视图控制器

    首先创建一个类,继承自UItabBarController 然后在.m文件中: 这里我有两个宏定义: #define WIDTH (myView.frame.size.width / 4) //我在写 ...

  4. 混合使用UITabBarController和UINavigationController

    混合使用这两个控件的好处是我们可以在NavigationBar添加更多的东西,如标题,按钮等.让用户能够获得更多的信息. UITabBarController的属性ViewControllers接受以 ...

  5. 基本组件的使用——UITabBarController

    和UINavigationController的作用差不多,UITabBarController也可以在多个UIViewController中切换 这个控件的使用相对简单,只需要为该控件的viewCo ...

  6. Swift - 重写UIKit框架类的init初始化方法(以UITabBarController为例)

    原来写了篇文章讲UITabBarController的用法,当时是从UIViewController跳转到UITabBarController页面,代码如下: 1 self.presentViewCo ...

  7. iOS 怎么设置 UITabBarController 的第n个item为第一响应者?

    iOS 怎么设置 UITabBarController 的第n个item为第一响应者? UITabBarController 里面有个属性:selectedIndex @property(nonato ...

  8. iOS UITabBarController的使用

    UITabBarController 和 UINavigationController 几乎是iOS APP的标配. UITabBarController分栏(标签栏)控制器, 和UINavigati ...

  9. iOS开发UI篇—UITabBarController简单介绍

    iOS开发UI篇—UITabBarController简单介绍 一.简单介绍 UITabBarController和UINavigationController类似,UITabBarControlle ...

随机推荐

  1. SDUT OJ 2783 小P寻宝记

    #include<iostream> #include<memory.h> #define N 10020 using namespace std; int dp[N],pi[ ...

  2. [mysqldumpslow 报错] Died at /usr/local/mysql/bin/mysqldumpslow line 161, &lt;&gt; chunk 236.

    mysqldumpslow报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, <> chunk 236. 总结:是由于top数目 ...

  3. aps.net要掌握的技术

    Spring.Net.NHibernate.Entity Framework.ASP.Net MVC.HTML5.WCF.数据库集群.分布式应用集群.高性能读写NoSql

  4. CSS display属性的值及作用

    display 的属性值有:none|inline|block|inline-block|list-item|run-in|table|inline-table|table-row-group|tab ...

  5. ssm+easyUI datagrid 不能显示后台controller层返回的json数据

    后台打印查询出来的数据: {"total":29,"rows":[{"department_id":0,"department_n ...

  6. C语言实现有序二叉树(1)

    在cpp中使用的C语言 头文件 /* 有序二叉树 BsTree */ #ifndef _BT_H #define _BT_H /*节点*/ typedef struct BsTreeNode { in ...

  7. 关于mysql使用dbForge调试的问题:Object 'test.p_insertRoute' does not exist.

    mysql中使用dbForge6.1版本调试存储过程,如果存储过程中定义的变量时枚举类型,那么就会报出该存储过程没有报出的错误,这个应该是dbForge6.1版本的bug

  8. 我定制的jquery ui主题

    打开网址 http://jqueryui.com/themeroller/,找到Gallery找到Redmond点击edit 将圆角设置成3px,让圆角更低调:将下面的每个Background的背景图 ...

  9. WIN7/8系统下程序接收不到WM_COPYDATA 消息的原因和解决

    在WIN7/win8,如果发送消息的程序用户权限低于和接收消息的程序,则消 息无法传递.发送程序必须等于或者等于接收程序的权限.如发送与接收 是同一个用户,或者发送是管理员帐户,接收是是普通用户,这样 ...

  10. submit与onsubmit(转)

    发生顺序:onsubmit -> submit 1.阻止表单提单: <script>function submitFun(){    //逻辑判断    return true; / ...