Swift_TabBarController

廢話很少說,直接上代碼app




func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {ide

        self.window = UIWindow(frame: UIScreen.mainScreen().bounds)spa

        // Override point for customization after application launch.3d

        self.window!.backgroundColor = UIColor.whiteColor()orm

        self.window!.makeKeyAndVisible()it

        

        // TabBarControllerio

        var navigationController_FirstView = UINavigationController(rootViewController:im

UIViewControllermargin

())
top

        navigationController_FirstView.tabBarItem = UITabBarItem(tabBarSystemItem:.Downloads, tag:1)

        

        var navigationController_SecondView = UINavigationController(rootViewController:

UIViewController

())

        navigationController_SecondView.tabBarItem = UITabBarItem(tabBarSystemItem:.Featured, tag:2)

        

        var navigationController_thirdView = UINavigationController(rootViewController:

UIViewController

())

        navigationController_thirdView.tabBarItem = UITabBarItem(tabBarSystemItem:.Featured, tag:3)

        

        

        var aryControllers = [navigationController_FirstView,navigationController_SecondView,navigationController_thirdView]

        

        var tabBarContol:UITabBarController = UITabBarController()

        tabBarContol.setViewControllers(aryControllers, animated: true)

        

        

        self.window!.rootViewController = tabBarContol

        

        

        return true

    }

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息