//
// HomeViewController.m
// UsingTabBarController01
//
// Created by chen neng on 11-9-5.
// Copyright 2011 ydtf. All rights reserved.
//
#import "HomeViewController.h"
@implementation HomeViewController
-(void)loadView{
[super loadView];
//一个动态数组,用于作为TabViewController的viewControllers;
NSMutableArray *viewControllerArray = [NSMutableArray array];
//创建第一个视图初始化
UIViewController *firstVC=[[UIViewController alloc]init];
firstVC.view.backgroundColor=[UIColor redColor];
//初始化第一个界面的下方的按钮的文字和图标房子文字是red,
firstVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Red" image:[UIImage imageNamed:@"index.png"] tag:1000];
//添加进视图数组中
[viewControllerArray addObject:firstVC];
[firstVC release];
UIViewController* secondVC=[[UIViewController alloc]init];
secondVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"blue" image:[UIImage imageNamed:@"settings.png"] tag:2000];
secondVC.view.backgroundColor=[UIColor blueColor];
[viewControllerArray addObject:secondVC];
[secondVC release];
UIViewController* thirdVC=[[UIViewController alloc]init];
thirdVC.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"yellow" image:[UIImage imageNamed:@"settings.png"] tag:2000];
thirdVC.view.backgroundColor=[UIColor yellowColor];
[viewControllerArray addObject:thirdVC];
[thirdVC release];
self.viewControllers = viewControllerArray;
}
@end