Update navigation bar appearance in SearchViewController
This commit is contained in:
parent
57380b9989
commit
407e0ae304
|
@ -85,6 +85,7 @@ extension SearchViewController {
|
||||||
title = L10n.Scene.Search.title
|
title = L10n.Scene.Search.title
|
||||||
|
|
||||||
setupSearchBar()
|
setupSearchBar()
|
||||||
|
setupNavigationBarAppearance()
|
||||||
|
|
||||||
// collectionView.translatesAutoresizingMaskIntoConstraints = false
|
// collectionView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
// view.addSubview(collectionView)
|
// view.addSubview(collectionView)
|
||||||
|
@ -113,6 +114,7 @@ extension SearchViewController {
|
||||||
])
|
])
|
||||||
|
|
||||||
// discoveryViewController.view.isHidden = true
|
// discoveryViewController.view.isHidden = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidAppear(_ animated: Bool) {
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
|
@ -164,6 +166,20 @@ extension SearchViewController {
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func setupNavigationBarAppearance() {
|
||||||
|
let appearance = UINavigationBarAppearance()
|
||||||
|
appearance.configureWithOpaqueBackground()
|
||||||
|
appearance.shadowColor = nil
|
||||||
|
|
||||||
|
navigationItem.standardAppearance = appearance
|
||||||
|
navigationItem.scrollEdgeAppearance = appearance
|
||||||
|
navigationItem.compactAppearance = appearance
|
||||||
|
|
||||||
|
if #available(iOS 15, *) {
|
||||||
|
navigationItem.compactScrollEdgeAppearance = appearance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - UISearchBarDelegate
|
// MARK: - UISearchBarDelegate
|
||||||
|
|
Loading…
Reference in New Issue