2016-10-12 5 views
-1

私は、4つのView Controllerがタブバーに追加されているアプリケーションを持っています。タブバーのView Controllerがナビゲーションスタック内の別のView Controllerをプッシュしているときに黒くなっています

最初のビューコントローラはリンク先ページです。 ビューコントローラは次のようにしてタブバーに追加されます。ランディングページから次に

SNZLandingViewController *landingViewController = [[UIStoryboard landingStoryboard] instantiateViewControllerWithIdentifier:SNZLandingIdentifier]; 

UINavigationController *landingNavigationController = [[UINavigationController alloc] initWithRootViewController:landingViewController]; 
[tabBarController addChildViewController:landingNavigationController]; 

ユーザーがボタン私は

ProductsDetailsViewController *detailsPage = [[UIStoryboard storyboardWithName:@"ProductsDetailsViewController" bundle:nil] instantiateViewControllerWithIdentifier:@"ProductsDetailsViewIdentifier"]; 
[self.navigationController pushViewController:detailsPage animated:YES]; 

今すぐ詳細ページが表示されますビューコントローラをプッシュしていますタップ。しかし、詳細ページの「戻る」をタップすると、ランディングページが表示され、完全に黒くなります。

奇妙なシナリオの1つは、ナビゲーションアニメーションが行われている間にリンク先ページが黒くなることです。私はここで何かを逃していますか? ヒントやご提案は大歓迎です。

+0

どこでこれらのコードを入れたのですか? – Zeb

+0

申し訳ありませんが、私はstackoverflowを使用して質問を書くのは初めてです。私は将来も維持します –

答えて

0

ナビゲーションバーがリンク先ページに表示されないようにしますか?

ランディングページにこれを置く:あなたのフォローアップのViewControllerに

override func viewWillAppear(animated: Bool) { 
    self.navigationController?.setNavigationBarHidden(true, animated: animated) 
    super.viewWillAppear(animated) 
} 

と、この:

override func viewWillAppear(animated: Bool) { 
    self.navigationController?.setNavigationBarHidden(false, animated: animated) 
    super.viewWillAppear(animated) 
} 

はここから取ら:iPhone hide Navigation Bar only on first page

+0

私はすでに自分のコードでこの実装を持っています。それでも動作しません。自動レイアウト制約がこれにつながる可能性はありますか? –

+0

また、最初に表示される詳細にはナビゲーションバーがありません。その後、私がタブを切り替えて戻ってくると、詳細バーにナビバーが表示されます。 –

+0

また、リンク先ページにはコンテンツビューが追加されたスクロールビューがあります。 –

関連する問題