-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fixed shell pages with top bar #20337
Conversation
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
_ = App.WaitForElement("page1"); | ||
|
||
// The content should not be overlaid by top bar | ||
App.Screenshot(); |
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.
Could use here App.VerifyScreenshot
?
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.
Sure!. Should I change it in all my UI tests? I think I wrote App.Screenshot();
instead of VerifyScreenshot
in all my PRs 😅
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.
It depends. If there are checks validating properties such as text, sizes, etc. is a correct additional validation. But if we are going to validate something (colors, sizes, etc.) with a screenshot, VerifyScreenshot
is the correct one.
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.
Thank you!
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
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.
I don't know if we can do this.
We intentionally got rid of the padding path.
With NET8 we set the additional insets
maui/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs
Lines 553 to 613 in 0da0a61
void LayoutHeader() | |
{ | |
if (ShellSection == null) | |
return; | |
int tabThickness = 0; | |
if (_header != null) | |
{ | |
tabThickness = HeaderHeight; | |
var headerTop = (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11) | |
#if TVOS | |
|| OperatingSystem.IsTvOSVersionAtLeast(11) | |
#endif | |
) ? View.SafeAreaInsets.Top : TopLayoutGuide.Length; | |
CGRect frame = new CGRect(View.Bounds.X, headerTop, View.Bounds.Width, HeaderHeight); | |
_blurView.Frame = frame; | |
_header.ViewController.View.Frame = frame; | |
} | |
nfloat left; | |
nfloat top; | |
nfloat right; | |
nfloat bottom; | |
if (OperatingSystem.IsIOSVersionAtLeast(11) || OperatingSystem.IsMacCatalystVersionAtLeast(11) | |
#if TVOS | |
|| OperatingSystem.IsTvOSVersionAtLeast(11) | |
#endif | |
) | |
{ | |
left = View.SafeAreaInsets.Left; | |
top = View.SafeAreaInsets.Top; | |
right = View.SafeAreaInsets.Right; | |
bottom = View.SafeAreaInsets.Bottom; | |
} | |
else | |
{ | |
left = 0; | |
top = TopLayoutGuide.Length; | |
right = 0; | |
bottom = BottomLayoutGuide.Length; | |
} | |
if (tabThickness > 0) | |
_additionalSafeArea = new UIEdgeInsets(tabThickness, 0, 0, 0); | |
else | |
_additionalSafeArea = UIEdgeInsets.Zero; | |
if (_didLayoutSubviews) | |
{ | |
var newInset = new Thickness(left, top, right, bottom); | |
if (newInset != _lastTabThickness || tabThickness != _lastTabThickness) | |
{ | |
_lastTabThickness = tabThickness; | |
_lastInset = new Thickness(left, top, right, bottom); | |
((IShellSectionController)ShellSection).SendInsetChanged(_lastInset, _lastTabThickness); | |
} | |
} | |
UpdateAdditionalSafeAreaInsets(); | |
} |
So someone could read from the SafeAreaInsets property to get the value and then use that for padding if they want to.
|
That would apply only to the top space, so that the content would always be below the tab bars. Another solution would to move tab bars and nav bar up so that they would ignore the safe area if |
I don't think so, I think because we are using AdditionalSafeAreaInsets the SafeAreaInsets property should be (notch + navbar + AdditionalSafeAreaInsets) If it's not, then that's a bug with our SafeAreaInsets platform specific.
Yea, the entire safe area story is super confusing :-/ we need to just rethink it with new APIs so we're hesitant to make more changes right now. |
Yes, if you're going to rethink the safe area stuff with new APIs, I think it might be better not to change anything and leave it as it is :) |
Yea, we're all very grumpy about safe areas right now. That new API Is it alright if we close this PR for now? |
Sure, no problem! |
Description of Change
The solution is based on the Page Rendered from Xamarin Forms
Issues Fixed
Fixes #19159
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-02-03.at.01.15.28.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-02-02.at.16.41.21.mp4