let vc1 = OneVC()
let nav1 = UINavigationController(rootViewController: vc1)
nav1.tabBarItem = UITabBarItem(title: "首页", image: UIImage(named: "dongTai"), selectedImage: UIImage(named: "dongTai_H"))
let vc2 = TwoVC()
let nav2 = UINavigationController(rootViewController: vc2)
nav2.tabBarItem = UITabBarItem(title: "返现", image: UIImage(named: "dongTai"), selectedImage: UIImage(named: "dongTai_H"))
let vc3 = ThreeVC()
let nav3 = UINavigationController(rootViewController: vc3)
nav3.tabBarItem = UITabBarItem(title: "购物", image: UIImage(named: "dongTai"), selectedImage: UIImage(named: "dongTai_H"))
let vc4 = FourVC()
let nav4 = UINavigationController(rootViewController: vc4)
nav4.tabBarItem = UITabBarItem(title: "我的", image: UIImage(named: "dongTai"), selectedImage: UIImage(named: "dongTai_H"))
let tbv = UITabBarController()
tbv.viewControllers = [nav1,nav2,nav3,nav4]
tbv.selectedViewController = nav2
self.window?.rootViewController = tbv
Swifttabbar
最新推荐文章于 2024-03-07 17:21:32 发布