UITabBarController
来源:互联网 发布:淘宝店卖什么好 编辑:程序博客网 时间:2024/05/16 14:08
跟UINavigationController类似,UITabBarController也可以轻松地管理多个控制器,轻松完成控制器之间的切换,典型例子就是QQ、微信等应用
UITabBarController的使用步骤
初始化UITabBarController
设置UIWindow的rootViewController为UITabBarController
根据具体情况,通过addChildViewController方法添加对应个数的子控制器
UITabBarController添加控制器的方式有2种
添加单个子控制器
- (void)addChildViewController:(UIViewController *)childController;
设置子控制器数组
@property(nonatomic,copy) NSArray *viewControllers;
如果UITabBarController有N个子控制器,那么UITabBar内部就会有N个UITabBarButton作为子控件
UITabBarButton里面显示什么内容,由对应子控制器的tabBarItem属性决定
UITabBarItem有以下属性影响着UITabBarButton的内容
标题文字
@property(nonatomic,copy) NSString *title;
图标
@property(nonatomic,retain) UIImage *image;
选中时的图标
@property(nonatomic,retain) UIImage *selectedImage;
提醒数字
@property(nonatomic,copy) NSString *badgeValue;
0 0
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- 文件夹的菜单栏和地址栏不见了
- TabActivity 的onkeydown失效问题
- C++ Primer第二章课后编程题
- tcp三次握手
- 原创文章
- UITabBarController
- 数组排序NSSortDescriptor
- Struts2从后台传递数据到前台的主要方法和流程
- Java中comparable和comparator接口的比较
- SVN的安装和更新
- Project Euler - 3
- 【线段树--区间修改】poj3468
- Hadoop+Mysql+hive安装步骤
- 怎么设置404错误跳转 在IIS