zoukankan      html  css  js  c++  java
  • swift-导航栏和tabbar(系统自带)

    1,在AppDelegate.swift里面(下面这个函数里面写)

        func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    //定义三个视图

       var oneview = Oneview()

            var twoview = Twoview()

            var threeview = ThreeView()

    //导航栏

            var threenav : UINavigationController = UINavigationController(rootViewController: threeview)

            var oneNav :UINavigationController = UINavigationController(rootViewController: oneview)

            var twoNav :UINavigationController = UINavigationController(rootViewController: twoview)

     //tabbar

            var oneItem :UITabBarItem = UITabBarItem(tabBarSystemItem: UITabBarSystemItem.Bookmarks, tag: 0)

            var twoItem :UITabBarItem = UITabBarItem(tabBarSystemItem: UITabBarSystemItem.Downloads, tag: 1)

            var treeItem :UITabBarItem = UITabBarItem(tabBarSystemItem: UITabBarSystemItem.Favorites, tag: 2)

            

            oneview.tabBarItem = oneItem

            twoview.tabBarItem = twoItem

            threeview.tabBarItem = treeItem

        var tc = UITabBarController()

            tc.tabBar.barTintColor = UIColor.blackColor()

            tc.viewControllers = [oneNav,twoNav,threenav]

            self.window?.rootViewController = tc;

      return true

    }

  • 相关阅读:
    手机端学习助手的说明书需求以及团队PM选择
    对其他组的作品的评审意见
    项目介绍
    beta版项目总结
    Beta版说明书
    Alpha版会议总结
    第一阶段绩效评估
    今日事意见汇总
    Alpha版使用说明
    评审建议
  • 原文地址:https://www.cnblogs.com/liaolijun/p/4583075.html
Copyright © 2011-2022 走看看