XMG UITabBarController
来源:互联网 发布:如何在淘宝上秒杀 编辑:程序博客网 时间:2024/05/11 22:08
1.构成
i.控制器的View
ii.UITabbar
iii.存放其他控制器View的view
2.UITabBar
如果UITabBarController有N个子控制器,那么UITabBar内部就会有N个UITabbBarButton作为子控件
UITabbar的使用
// 设置窗口的跟控制器
UITabBarController *tabBarVc = [[UITabBarControlleralloc] init];
self.window.rootViewController = tabBarVc;
UIViewController *vc = [[UIViewControlleralloc] init];
vc.view.backgroundColor = [UIColorredColor];
// 添加子控制器
[tabBarVc addChildViewController:vc];
// 设置按钮上面的内容
vc.tabBarItem.title =@"消息";
vc.tabBarItem.image = [[UIImageimageNamed:@"tab_recent_nor"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] ;
vc.tabBarItem.badgeValue =@"1000";
UIViewController *vc1 = [[UIViewControlleralloc] init];
vc1.view.backgroundColor = [UIColorgreenColor];
// 添加子控制器
[tabBarVc addChildViewController:vc1];
vc1.tabBarItem.title =@"联系人";
vc1.tabBarItem.badgeValue =@"10";
vc1.tabBarItem.image = [[UIImageimageNamed:@"tab_recent_nor"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] ; //让图片不被渲染
// 显示窗口
[self.windowmakeKeyAndVisible];
- XMG UITabBarController
- XMG
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- HDU-ACM1003
- 布隆过滤器详解
- 主元素问题
- 电子设计不得不说的接地技术
- 修改ubuntu终端的傻不垃圾的背景颜色
- XMG UITabBarController
- Java汉字转拼音pinyin4j用法
- 滤波器
- 扩展欧几里得算法证明过程
- android插件化开发——加载广播
- 轻量级日志类Log
- C# 编码转换 UTF8转GB2312 GB2312转UTF8
- HDU--ACM1004
- ASPX文件转HTML