Skip to content
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

iOS 10 - prefersStatusBarHidden not called in presented ViewController #112

Open
omarojo opened this issue Sep 22, 2016 · 6 comments
Open

Comments

@omarojo
Copy link

omarojo commented Sep 22, 2016

For some reason this was working well in iOS 9. but in iOS 10.
The statusBar is not getting hidden after being presented. I added
formSheetController.modalPresentationCapturesStatusBarAppearance = YES;
which I didnt have before. But still not working.

Im calling
[self setNeedsStatusBarAppearanceUpdate];
in viewDidLoad.

-(BOOL)prefersStatusBarHidden{
    return YES;
}
@m1entus
Copy link
Owner

m1entus commented Sep 23, 2016

Have you tried "To specify that a child view controller should control preferred status bar hidden/unhidden state, implement the childViewControllerForStatusBarHidden method." ? Are you setting prefersStatusBarHidden in good VC, in iOS10 something could changed

@omarojo
Copy link
Author

omarojo commented Sep 24, 2016

@m1entus sorry.. where exactly should I be putting the ``childViewControllerForStatusBarHidden` method ?

In the ViewController being presented or in the ViewController that is instantiating the MZform and then presenting it?

In my case.. the ViewController that is presenting.. is hiding the statusbar properly by calling -(BOOL)prefersStatusBarHidden. It is after it presents the MZform, that the presented VC brings back the statusbar.

@maross
Copy link

maross commented Oct 4, 2016

Any updates? Do I need to subclass MZFormSheetPresentationViewController?

@omarojo
Copy link
Author

omarojo commented Oct 15, 2016

@maross I tried everything.. nothing makes the statusbar to disappear.

@m1entus
Copy link
Owner

m1entus commented Oct 16, 2016

If you guys prepare short example where can i reproduce it, i will help you guys!

@hyuni
Copy link

hyuni commented Sep 20, 2017

@omarojo your code is ok. but MZFormSheetPresentationController has bug.
add code preferredStatusBarStyle override

see https://github.com/m1entus/MZFormSheetPresentationController/pull/143/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants