美文网首页
新建UITabbarcontroller用swift

新建UITabbarcontroller用swift

作者: 盖世英雄的梦想 | 来源:发表于2018-10-21 20:15 被阅读0次

    在AppDelegate当中写

    let one = oneViewController()
    let nav1 = UINavigationController(rootViewController: one)
    nav1.tabBarItem = UITabBarItem(title: "呵呵", image: UIImage(named: ""), tag: 1)

        let er = erViewController()
        let nav2 = UINavigationController(rootViewController: er)
        nav2.tabBarItem = UITabBarItem(title: "哈哈", image: UIImage(named: ""), tag: 1)
        
        let tbv = UITabBarController()
        
        tbv.viewControllers = [nav1,nav2]
        
        self.window?.rootViewController = tbv

    相关文章

      网友评论

          本文标题:新建UITabbarcontroller用swift

          本文链接:https://www.haomeiwen.com/subject/fokizftx.html