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

Status bar is bright when contentViewController is presented #39

Closed
ghost opened this issue Nov 23, 2015 · 9 comments
Closed

Status bar is bright when contentViewController is presented #39

ghost opened this issue Nov 23, 2015 · 9 comments

Comments

@ghost
Copy link

ghost commented Nov 23, 2015

The status bar style is .LightContent, I hope it will be dim when when contentViewController is presented. However, it is bright which seems like highlighted with a dim background.
Any advice?

@ghost
Copy link
Author

ghost commented Nov 24, 2015

I know one of the solutions is to create a new UIWindow and set its windowLevel to UIWindowLevelStatusBar, but I think it should be done in MZFormSheetPresentationController.

@m1entus
Copy link
Owner

m1entus commented Nov 24, 2015

Lol... Of course not, you need to just override preferredStatusBarStyle in your contentViewController and make sure that call setNeedsStatusBarAppearanceUpdate, and just set modalPresentationCapturesStatusBarAppearance = YES; to MZFormSheetPresentationController, and read this: http://stackoverflow.com/questions/23615647/uiviewcontrollers-prefersstatusbarhidden-not-working

@m1entus m1entus closed this as completed Nov 24, 2015
@ghost
Copy link
Author

ghost commented Nov 24, 2015

I have tried your suggestion and realized you have misunderstood my question. I didn't mean changing preferredStatusBarStyle by saying dim. I want the status bar to be covered by a transparent black view just like the background view instead of above the view. Do you get my point?

@m1entus
Copy link
Owner

m1entus commented Nov 24, 2015

On Apple Guidlines status bar is always on the top, MZFormSheetPresentationController is using presentation controllers which is recommended by apple and not using UIWindow presentation as MZFormSheetController and it won't in future.

@ghost
Copy link
Author

ghost commented Nov 24, 2015

untitled
untitled 2
The effect I want is the second one. I am sorry if I didn't express clearly before. I think it is possible because in your demo it is the second effect.

@m1entus
Copy link
Owner

m1entus commented Nov 24, 2015

In my demo is the first one, and as i said i am using native way for presenting view controllers, apple is doing in this way so do i.

@ghost
Copy link
Author

ghost commented Nov 24, 2015

Ok..., thank you anyway. You must be mad at me right now. So sorry.

@eliburke
Copy link
Contributor

I don't think he's mad. I think he's trying to tell you that what you want can't be done using automatic behavior with MZFormSheetPresentationController. It could be done in the older version using MZFormSheetController, which used UIWindow presentation.

Perhaps you can accomplish what you want by tinting the status bar in the completion blocks for showing and dismissing your modal view?

@m1entus
Copy link
Owner

m1entus commented Nov 24, 2015

Yep, i am not mad, just wanted to tell you that this is not how Apple designed their presenters, and even popover controller have status bar always on top. Good catch @eliburke , you can always make screenshot of status bar window, and then add it below dimming view in form sheet presentation controller, and hide status bar. You will get this effect.

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

2 participants