UITabBarController *tabbarController=[[UITabBarController
alloc]init];
AreaViewController *area=[[AreaViewController alloc]init];
BulkViewController *bulk=[[BulkViewController alloc]init];
SumViewController *sum=[[SumViewController alloc]init];
tabbarController.viewControllers=@[area,bulk,sum];
UITabBar *tabBar = tabbarController.tabBar;
UITabBarItem *tabBarItem1 = [tabBar.items objectAtIndex:0]; UITabBarItem *tabBarItem2 = [tabBar.items objectAtIndex:1]; UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2]; [tabBarItem1 setTitle:@"面积"];
[tabBarItem1 setImage:[UIImage imageNamed:@"Area.png"]]; [tabBarItem2 setTitle:@"体积"];
[tabBarItem2 setImage:[UIImage imageNamed:@"Volume.png"]]; [tabBarItem3 setTitle:@"统计"];
[tabBarItem3 setImage:[UIImage imageNamed:@"Summary.png"]];
self.window.rootViewController=tabbarController; |
|