您的位置:首页 > 产品设计 > UI/UE

UI13-UITabBarController底部导航视图

2017-08-23 09:27 239 查看
分别创建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;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息