2016-11-07 6 views
0

スクロールでタイトルを表示してもナビゲーションバーが表示されません。私はxCodeとプログラムでそれを設定しようとしました。いずれにせよ、問題はまだそこにある。ここで enter image description hereスクロール/スワイプで隠した後にUINavigationBarが再度表示されない

override func viewDidAppear(animated: Bool) { 
     super.viewDidAppear(animated) 

     navigationController?.hidesBarsOnSwipe = true 
    } 

それはナビゲーションバーを非表示にした後のように見えるものです。ステータスバーの色も白から黒に変わりました。 viewDidLoadで

enter image description here

私が持っている:

//MARK: navigation bar styles 
     self.navigationController?.navigationBar.backgroundColor = UIColor.init(red: 26/255, green: 24/255, blue: 24/255, alpha: 1) 
     self.navigationController?.navigationBar.clipsToBounds = true 
     self.navigationController?.navigationBar.titleTextAttributes = [NSFontAttributeName:UIFont(name:"GillSans", size: 20)!] 

誰もがこのための良い解決策を持っていますか?ご協力いただきありがとうございます!

+0

あなたは、コード内の別のnavigationControllerを使用しましたか? – KKRocks

+0

あなたはviewDidLoadを投稿できますか? – Joe

+0

@KKRocksそうは思わない。私はself.navigationControllerを使用しようとしましたが、それはまだ同じです – WoShiNiBaBa

答えて

0

は、このコードを試してみてください。

注:あなたが黒に近いお使いのナビゲーションバーの背景の設定など。ステータスバーの内容を明るくする必要があります。

//あなたのViewControllerでコードの下

View controller-based status bar appearance = NO 

であなたのplistを更新します。

title = "Some Title" 

    navigationController?.navigationBar.barTintColor = UIColor(red: 26/255, green: 24/255, blue: 24/255, alpha: 1) 
    navigationController?.navigationBar.tintColor = UIColor.white 

    //Title Colour and Font 
    navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.white, NSFontAttributeName:UIFont(name:"Arial", size: 20)!] 

    navigationController?.navigationBar.clipsToBounds = false 
    UIApplication.shared.statusBarStyle = .lightContent 
    } 


    override func viewDidAppear(_ animated: Bool) { 

    navigationController?.hidesBarsOnSwipe = true 

    } 

出力:

enter image description here

+0

plistファイルを更新する理由は何ですか? //ステータスバーのスタイルを変更します。 override func preferredStatusBarStyle() - > UIStatusBarStyle { return UIStatusBarStyle.LightContent }スクロール後もナビゲーションバーは表示されません。 – WoShiNiBaBa

関連する問題