-
Notifications
You must be signed in to change notification settings - Fork 1.8k
26598 - Fix for Tabbar disappears when navigating back from page with hidden TabBar in iOS 18 #27582
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
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/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've created an alternate PR here
#27617
let me know your thoughts.
I think the main problem here is that we are sending an appearing event too early so the call to (Page.FindParentOfType<ShellItem>() as IShellItemController)?.ShowTabs
is being calculated against the previous page instead of the incoming page
I'm thinking if we fix this appearing a bit that it might fix a few different quirks with appearing.
If you agree, can you just modify this PR with my changes? Then we can just merge this PR once it's ready.
@PureWeen I have tested the reported issue with this fix, and it works fine. however, in the scenario where the first page has public class Issue26598Home : ContentPage
{
VerticalStackLayout stackLayout;
Button button;
public Issue26598Home()
{
Title = "Home";
HeightRequest = 200;
stackLayout = new VerticalStackLayout();
button = new Button()
{
Text = "Navigate to InnerTab",
AutomationId = "NavigateToInnerTab",
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
};
button.Clicked += Button_OnClicked;
stackLayout.Add(button);
Shell.SetTabBarIsVisible(this, false);
this.Content = stackLayout;
}
private void Button_OnClicked(object sender, EventArgs e)
{
Shell.Current.GoToAsync(nameof(Issue26598Inner));
}
}
public class Issue26598Inner : ContentPage
{
VerticalStackLayout stackLayout;
Button button;
public Issue26598Inner()
{
Title = "InnerTab";
stackLayout = new VerticalStackLayout();
button = new Button()
{
Text = "Navigate to TabBarPage",
AutomationId = "NavigateToTabBarPage",
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
};
button.Clicked += Button_OnClicked;
stackLayout.Add(button);
Shell.SetTabBarIsVisible(this, true);
this.Content = stackLayout;
}
private void Button_OnClicked(object sender, EventArgs e)
{
Shell.Current.GoToAsync(nameof(Issue26589NonTab));
}
} ShellIssue.mov |
Dang! Alright, let's just take both our fix than and can you create another test for the additional scenario you've pointed out here? |
} | ||
} | ||
|
||
public class Issue26598Home : ContentPage |
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.
Can you move all these classes to be inner classes of Issue26598
so they don't pollute the namespace?
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.
Yes @PureWeen! I have refactored the code by moving all the classes inside Issue26598
as inner classes.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@PureWeen, I have added the additional scenario in the same test case. Kindly review the test cases and let me know if you have any concerns |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
navPage.SendAppearing(); | ||
|
||
// We use this inside ModalNavigationManager to indicate that we're going to be popping multiple | ||
// modal pages so we don't want it to fire any appearing events |
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 we do something in the UI from the UITest, like update a Label Text, to validate the correct behavior with the Appearing method?
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.
This existing test covers the modal scenario here
- PoppingModalStackFiresAppearingOnRevealedModalPage
I've added
- PoppingModalStackFiresAppearingOnRevealedNonModalPage
To cover popping multiple pages down to a shell page to ensure appearing still fires
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
Issue Details
When
TabBarIsVisible
is set to false on an inner page, navigating back to the previous page and switching between tabs causes the tab bar visibility to not update correctly.Root Cause
In iOS 18,
UIViewController.HidesBottomBarWhenPushed
does not reliably update the tab bar visibility. This property must be set before the page is pushed, which leads to inconsistent behavior when toggling between tabs.Description of Change
For iOS 18 and later, tab bar visibility is effectively managed using the
TabBarHidden
property. Therefore, I have restricted the use ofUIViewController.HidesBottomBarWhenPushed
to iOS versions prior to 18 within theUpdateTabBarVisible
method.Issues Fixed
Fixes #26598
Tested the behaviour in the following platforms
Known Issue
ItemsUpdatingScrollMode
is not implemented in CollectionView2Output Screenshot
Before.mov
After.mov