分别创建PhotoAlbumViewController、ShootViewController、MyViewController三个视图控制器器
在AppDelegate中编写代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
//创建ShootViewController对象
ShootViewController *shoot = [[ShootViewController alloc] init];
//创建PhotoAlbumViewController对象
PhotoAlbumViewController *album = [[PhotoAlbumViewController alloc]init];
//创建MyViewController对象
MyViewController *my = [[MyViewController alloc] init];
//创建UITabBarController对象,将前面创建的视图控制器加入该对象
UITabBarController *tabBarController = [[UITabBarController alloc]init];
tabBarController.viewControllers = @[album,shoot,my];
self.window.rootViewController = tabBarController;
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}