1つのView Controllerのナビゲーションバーのみを半透明にし、他の属性を変更しようとしています。Swift 4 1つのView Controllerのナビゲーション属性を設定する
ユーザーがこのVCを離れると、私はAppDelegateに持っているもの、すなわち「正常」に戻ることができます。
viewWillDisappearの各行をリセットする必要がありますか?もしそうなら、私はデフォルトのナビゲーションバーの設定として、バックグラウンドの画像/影の画像に何を使用しますか?
// Make Nav Bar Translucent and Set title font/color
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.view.backgroundColor = .clear
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white, NSAttributedStringKey.font: UIFont.systemFont(ofSize: 20, weight: .semibold)]
を使用することができる利用可能ないくつかのサードパーティ製のcocoapodsがあります。 'viewWillDisappear'。 – matt