0
私はナビゲーションバーをプログラムで設定したビューを入力するときを除いて、すべてがうまく動作します(セグから設定、リセット機能)。ナビゲーションバーのエラー
カスタムナビゲーションバーは表示されますが、カスタムの戻るボタンを実装すると、問題のあるナビゲーションバーと同じナビゲーションバーが表示されます(今度はリセットボタンと設定ボタンがすべて表示されます)。
ナビゲーションバーをその特定のビューに対してのみカスタムにする方法はありますか?コードの
パート:
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
self.navigationController?.navigationBar.shadowImage = UIImage()
//Add gesture to MainLabel
let tapLabel: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(resetTime))
tapLabel.delegate = self
mainLabel.isUserInteractionEnabled = true
mainLabel.addGestureRecognizer(tapLabel)
//Add gesture to UINavigationBar title
let tapTitle: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(resetTime))
tapTitle.delegate = self
self.navigationItem.titleView = resetLabel
self.navigationItem.titleView?.isUserInteractionEnabled = true
self.navigationItem.titleView?.addGestureRecognizer(tapTitle)
}