0
正如標題所說,請問UITabbarItem沒有,如果我在一個UINavigationController嵌入像這樣出現:的UITabBarController UITabbarItem不會出現時的UINavigationController被包埋
lazy var tabBarViewController: UITabBarController = {
let tBarViewController = UITabBarController()
let firstViewController = ViewController()
firstViewController.tabBarItem.title = "Home"
tBarViewController.viewControllers = [UINavigationController(rootViewController: firstViewController)]
return tBarViewController
}()
lazy var window: UIWindow = {
let win = UIWindow(frame: UIScreen.mainScreen().bounds)
win.backgroundColor = UIColor.whiteColor()
win.rootViewController = self.tabBarViewController
return win
}()
func customizeAppereance() {
UINavigationBar.appearance().barTintColor = UIColor.themeColor()
UITabBar.appearance().barTintColor = UIColor.themeColor()
}
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
customizeAppereance()
UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: .Fade)
window.makeKeyAndVisible()
return true
}
如果我刪除的UINavigationController它的工作原理並且UITabbarItem可見。 如何嵌入UINavigationController並讓UITabbarItem出現? (我不使用NIB或Storyboard,只是代碼)?