-
Notifications
You must be signed in to change notification settings - Fork 113
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 style is being overridden after a popover is displayed #2
Comments
@ShezHsky thanks for raising the issue! I’ll take a look. |
Interesting, it does seem to be a problem with the presented window. Working on it. |
Setting Popover.sheet.status.bar.mov |
Yep makes sense - my first thought would be to change its visibility in tandem with whether there are any popovers to present, so the status bar returns to normal programming once all popovers have been dismissed. An alternative approach I took a quick stab at this afternoon was attempting to present the view controller containing the popover within the same window. I've pushed a rough attempt at the idea to my fork, this might also help your other question (#3) as you can ask the window for it's scene via |
Woah, nice! Thanks again. I'll check it out. |
Cool approach. There's some weird animations currently but should be fixable. I'll do some more testing with the view controllers and see if there's any drawbacks. Btw thanks for |
In the meantime I'll add a bounty to that stack overflow question. There could be some random property that you need to set or whatever... |
Seems like there's a private API that can help with this... /// Private API overrides for status bar appearance
/// http://www.openradar.me/15573442
/// http://www.openradar.me/30064691
/// https://openradar.appspot.com/23677818
@objc(_canAffectStatusBarAppearance)
private var canAffectStatusBarAppearance: Bool {
false
} from omaralbeik/Drops#22 |
Howdy,
While integrating this library into an app (thanks for the work on this by the way!), I noticed the status bar is disappearing when presenting sheets. It looks like the offender is around the use of a second
UIWindow
to draw the popovers, as this now receives priority for status bar styling preferences. This is evident when a popover is first shown as, especially from a sheet, the status bar returns to its default colouring once the second window is prepared - meaning it blends in with the background. Future presentations will then be stuck with the status bar styling from the second window, which usually means no status bar for sheets (except in dark mode).I've added a commit to my fork to demonstrate the issue inside the sample app, however as the sample app already prepared the secondary window the status bar is always hidden at presentation time. To make life easier, here's a quick video:
Popovers.mov
I had a quick 15 min stab at this but didn't find a quick win. My line of thinking was to remove the window when no more popovers are being displayed as a mitigation step, so the status bar is available for future sheet presentations/once the popover is dismissed. There might be a fancier way forward by rendering the popovers onto an overlayed view controller instead of a window, but that seems like a fairly large change (and may come with its own bugs!).
While I'll give one of the above another go in due course (i.e. post holidays), I'm raising it here in case anyone else bumps into this issue/fancies giving it a go, or if there's other ideas to consider to address this. Cheers
The text was updated successfully, but these errors were encountered: