私のアプリは、すべてのビューは、4ボタンを押して、A、B、Cにジャンプしてみましょう とタブバーを持つビューAにDプログラムで複数のナビゲーションコントローラを追加するにはどうすればよいですか?
を開始し、私が現在持っていることは、このシナリオは次のとおりです。
A、B、C、Dのいずれかに移動すると、スタックの最下部に戻る 上のすべてのものが一掃されます。
が、私は、私はBに1から移動するときに、これらのナビゲーションは今
1: A>1
2: B>3>7
3: C>2>5>6>8>7
4: D>9>1
が起こっ例えば、それは、この画像のように行動する必要があるが、私はB
のトップであるバック7へ行きます質問:複数のナビゲーションコントローラが必要な場合はありますか?私はappDelegate
のdidFinishLaunchingWithOptions
の機能にこれを入れて、複数のナビゲーションコントローラをプログラム的に行う方法は? A、Bプッシュまたはロードビューコントローラの間で使用するものは何ですか?
////////// NC
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let mainView = storyboard.instantiateViewControllerWithIdentifier("selectLocation") as! selectLocation // 1 Home
let searchView = storyboard.instantiateViewControllerWithIdentifier("2") as! Search // 1 Home
let friendsView = storyboard.instantiateViewControllerWithIdentifier("3") as! Friends // 1 Home
let meView = storyboard.instantiateViewControllerWithIdentifier("4") as! Me // 1 Home
var nav1 = UINavigationController()
nav1.viewControllers = [mainView]
nav1.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
var nav2 = UINavigationController()
nav2.viewControllers = [searchView]
nav2.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
var nav3 = UINavigationController()
nav3.viewControllers = [friendsView]
nav3.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
var nav4 = UINavigationController()
nav4.viewControllers = [meView]
nav4.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
UINavigationBar.appearance().barTintColor = UIColor(red: 176.0/255.0, green: 190.0/255.0, blue: 105.0/255.0, alpha: 1.0)
UINavigationBar.appearance().tintColor = UIColor.whiteColor()
UINavigationBar.appearance().barStyle = UIBarStyle.BlackTranslucent
self.window!.rootViewController = nav1
self.window?.makeKeyAndVisible()
////////// NC
通知: - これを解決しました。解決策が必要な場合は、サンプルgithubプロジェクトを準備し、ここにリンクします。 – DeyaEldeen
あなたはそのGitHubサンプルを入手できましたか? – SQLiteNoob