fix share screen nav bar UI for iOS 15

This commit is contained in:
ryanzhao 2021-10-01 09:30:45 +10:00
parent 7aa751ca45
commit 6b81d78d43
1 changed files with 13 additions and 0 deletions

View File

@ -36,6 +36,7 @@ final class ThreadPickerVC : UIViewController, UITableViewDataSource, UITableVie
// MARK: Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
setupNavBar()
// Gradient
view.backgroundColor = .clear
let gradient = Gradients.defaultBackground
@ -68,6 +69,18 @@ final class ThreadPickerVC : UIViewController, UITableViewDataSource, UITableVie
reload()
}
private func setupNavBar() {
guard let navigationBar = navigationController?.navigationBar else { return }
if #available(iOS 15.0, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = Colors.navigationBarBackground
appearance.shadowColor = .clear
navigationBar.standardAppearance = appearance;
navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance
}
}
// MARK: Table View Data Source
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return Int(threadCount)