tabbar=[[UITabBarController alloc]init];
NSMutableArray *array = [[NSMutableArray alloc] init];
ViewController * vc=[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
tabbar.title=@"Home";
HomeViewController *hvc= [[HomeViewController alloc]initWithNibName:@"HomeViewController" bundle:nil];
hvc.tabBarItem.title=@"Home";
hvc.tabBarItem.image=[UIImage imageNamed:@"home.png"];
SettingViewController* svc =[[SettingViewController alloc]initWithNibName:@"SettingViewController" bundle:nil];
svc.tabBarItem.title=@"My Hospital";
svc.tabBarItem.image=[UIImage imageNamed:@"myhospital.png"];
[array addObject:hvc];
[array addObject:svc];
[array addObject:vc];
tabbar.viewControllers = array;
tabbar.view.autoresizingMask=UIViewAutoresizingFlexibleBottomMargin;
[self.view addSubview:tabbar.view];
我已经成功编写了这个代码标签栏,但我的问题是它会直接在第一个标签中显示第二个窗口我想在第一个标签上看到第一个视图我该怎么做提前谢谢..