-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
childViewControllerForStatusBarStyle
and preferredStatusBarStyle
don't work.
#25
Comments
If you can paste your code here , it will helps a lot! Thanks. |
I customized the class NavigationViewController: UINavigationController {
override var childViewControllerForStatusBarStyle: UIViewController? {
return self.topViewController
}
} Below is the appDelegate code func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
#if DEBUG
CocoaDebug.enable()
#endif
window = UIWindow(frame: UIScreen.main.bounds)
window?.backgroundColor = .white
let nav = NavigationViewController(rootViewController: ViewController())
window?.rootViewController = nav
window?.makeKeyAndVisible()
return true
} Code in viewController class ViewController: UIViewController, UIScrollViewDelegate {
var offset: CGFloat = 0
override func viewDidLoad() {
super.viewDidLoad()
let scrollView = UIScrollView(frame: view.bounds)
scrollView.contentSize = CGSize(width: UIScreen.main.bounds.size.width, height: 1000)
scrollView.delegate = self
view.addSubview(scrollView)
}
override var preferredStatusBarStyle: UIStatusBarStyle {
return offset >= 1 ? .lightContent : .default
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let offsetY = scrollView.contentOffset.y/100
offset = offsetY
setNeedsStatusBarAppearanceUpdate()
}
} |
MQZHot
added a commit
to MQZHot/CocoaDebug
that referenced
this issue
Jul 21, 2018
New version published, please update. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I install CocoaDebug,
childViewControllerForStatusBarStyle
andpreferredStatusBarStyle
don't work.The text was updated successfully, but these errors were encountered: