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,只是代码)?