-
Notifications
You must be signed in to change notification settings - Fork 412
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] StatusBarBehavior does not occupy entire notch - fix #2309
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please link to a bug (or open a new Issue) in our GitHub repo to help us understand + reproduce the problem you are trying to fix.
Please also update edit the title of this PR; Improve status bar
does not explain the bug or the proposed solution.
Please ensure the status bar does not overlap the navigation bar
This PR increases the size of the StatusBar where it now overlaps the NavigationBar
This is the issue #2287, Originally I thought it was a maui issue but its not and actually a status bar behaviour issue, since the repro app doesn't apply the padding when not using the behavior |
Another report of this bug: dotnet/maui#25435 Additionally I also ran into this myself while working on the https://github.com/jfversluis/blazor-hybrid-workshop |
Hi! Any update concerning this PR? |
@brminnick what do you think about @kubaflo's answer? |
This is a tough one. Both the Community Toolkit and .NET MAUI are correctly using SafeAreaInserts. This appears to be how iOS has designed their operating system UI. I've searched Apple's Human Interface Design Guidelines to learn more about their recommendations around the status bar and modality, but they don't provide any specific instructions. Since this "bug" only seems to affect Modal Pages, my recommendation is to use My vote is to close both this PR and the Issue as this is the design that Apple is pushing us developers into. |
To answer @kubaflo's question, we are blocked from merging any PRs until we are able to merge our .NET 9 PR which is currently blocked by a bug in .NET MAUI. Once the MAUI engineering team resolves this bug, we will be unblocked and can resume merging PRs for the Community Toolkit: dotnet/maui#25871 |
Okay, @brminnick do whatever you think is the best :) But I don't think it happens only on modal pages, it happens on pages without a navigation bar |
I'm thinking about this PR because I've just forked this behaviour and had to make this change as I can't live with the random line between my nav bar and notch and it got me thinking... Should we add a toggle option for iOS to use the safe area: The default behavior would be to use the status bar frame, and the override would use the top of the safe area. This way we have a fix for this issue, which IS quite common. We don't force developers down the road of making all modals @brminnick thoughts? |
@Axemasta That actually makes a lot of sense! Do you have a proof-of-concept with it working that I could dig into? |
I've put together a proof of concept although to be totally honest I think adding a Proof of concept is here, annoyingly the For the proof of concept:
In the specific case of the Looking at the current implementation of status bar, we'd probably want to pass the if (StatusBarIosConfiguration.GetUseSafeArea(bindable))
{
new CGRect(statusBar.Frame.X, statusBar.Frame.Y, statusBar.Frame.Width, window.SafeAreaInsets.Top);
}
else
{
statusBar.Frame = UIApplication.SharedApplication.StatusBarFrame;
} Adding a toggle to the page might be a bit confusing, I was hoping it wouldn't be as messy as it turned out to be (accounting for the |
@kubaflo @Axemasta as discussed yesterday on the .NET MAUI Community Toolkit standup, if we compare the behavior with the behavior of native iOS apps this seems to be correct. Reading through this I think the suggestion by @Axemasta makes a lot of sense! Do we need a separate setting? Can't we just look at the .NET MAUI configured setting for this on the page that we're on and decide based on that? But I'm fine with adding a platform-specific setting for this too. Can we make that happen? :) |
68e0ba2
to
589d13c
Compare
I've added
Let me know what you think :) |
589d13c
to
feb1571
Compare
Description of Change
I've encountered this bug while working with MAUI: dotnet/maui#24972 and it turns out that it is rather an issue that should be linked to this repository.
Basically the status bar is wrong for some screens. I've found this comments here: https://forums.developer.apple.com/forums/thread/662466
It makes sense because when I based the status bar height on the top safe area I have the following result:
Linked Issues
It might also fix this one: dotnet/maui#25435, but I'm not 100% sure if it is a status bar's or MAUI's issue. Maybe even both
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information