I use collectionView in my app and set status bar style to light and set hidesBarsOnSwipe
of navigationController
to true. But when I scroll cell up, navigationController is hides, but status bar turn to black color. and back to white when scroll collectionView to down. this is my code for navigationController:
extension UINavigationController {
override open var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
func transparentNavigation() {
guard let pacificoFont = UIFont(name: "Pacifico", size: 20) else {return}
navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.foregroundColor, NSAttributedStringKey.font: pacificoFont]
navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
navigationBar.shadowImage = UIImage()
navigationBar.isTranslucent = true
view.backgroundColor = .clear
hidesBarsOnSwipe = true
}
}
Is there any way to repair this "feature"?