迅速XIBファイルを使用しているプログラムでナビゲーションコントローラを追加する方法は、私は、ナビゲーションバーを作成したいが、何も起こりません
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let viewController = DummyViewController(nibName: nil, bundle: nil)
let navigationController = UINavigationController(rootViewController: viewController)
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()
let tabBarController = UITabBarController()
let tabViewController1 = DummyViewController(
nibName: "DummyViewController",
bundle: nil)
let tabViewController2 = SearchViewController(
nibName:"SearchViewController",
bundle: nil)
tabViewController1.tabBarItem = UITabBarItem(
title: "Location",
image: UIImage(named: "ic_location_blue"),
tag: 1)
tabViewController2.tabBarItem = UITabBarItem(
title: "Search",
image:UIImage(named: "ic_search_blue") ,
tag:2)
let controllers = [tabViewController1,tabViewController2]
tabBarController.viewControllers = controllers
window?.rootViewController = tabBarController
return true
}
に思えますファイル、および一緒にナビゲーションコントローラとタブバーコントローラを一緒に使用する方法を知らない前に、感謝します。
を使用して解決しましたか? – Vive