UITabBarController 简单例子
来源:互联网 发布:java语言入门培训班 编辑:程序博客网 时间:2024/05/21 21:38
这里做个记录以免以后忘记。
例子:http://download.csdn.net/detail/qqmcy/6916253
首先,创建UITabBarController类的对象。
ViewController.h
#import <UIKit/UIKit.h>@interface ViewController : UIViewController<UITabBarControllerDelegate>@property (strong , nonatomic) UITabBarController* m_tabBarVC;@end
ViewController.m
- (void)viewDidLoad{ [super viewDidLoad];// Do any additional setup after loading the view, typically from a nib. self.m_tabBarVC = [[UITabBarController alloc] init]; self.m_tabBarVC.delegate = self; OrangeViewController* orangeVC = [[OrangeViewController alloc] initWithStyle:UITableViewStylePlain]; RedViewController* redVC = [[RedViewController alloc] initWithNibName:@"RedViewController" bundle:nil]; self.m_tabBarVC.viewControllers = @[redVC,orangeVC]; //self.m_tabBarVC.view.frame = CGRectMake(0, 0, 320, <#CGFloat height#>) [self.view addSubview:self.m_tabBarVC.view];}
OrangeViewController.m
UITabBarItem* item = [[UITabBarItem alloc] initWithTitle:@"2" image:[UIImage imageNamed:@"changmen.jpg" ] tag:2]; self.tabBarItem = item;
0 0
- UITabBarController 简单例子
- 自定义UITabBarController的简单例子
- 自定义UITabBarController简单方法
- UITabBarController的简单使用
- 简单介绍UITabBarController使用
- UITabBarController的简单使用
- UITabBarController简单介绍
- UITabBarController简单的使用
- UITabBarController简单介绍
- IOS--UITabBarController简单介绍
- UITabBarController(一)简单操作
- UINavigationController和UITabBarController共存的例子
- UINavigationController和UITabBarController共存的例子
- UITabbarController
- UITabBarController
- UITabBarController
- UITabBarController
- UITabBarController
- DOJO 基本原理 之 dojo/_base/declare<7>
- springMVC系列之参数、多方法、配置文件加载——02
- oracle导入导出工具exp/imp
- NYOJ 261 玩转矩阵的C小加
- 触发、清除 haslayout的css属性
- UITabBarController 简单例子
- CSS选择符
- 帧边界识别简介
- ORACLE事物隔离级别
- Mongodb java代码
- sql取得不包含某数据的字段。。。not in
- JZ4770 UBOOT阅读 (MIPS)
- Web开发者不容错过的20段CSS代码
- Flex SWFLoader 自動卸載外部 SWF 動畫