-
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
Fix Android flyout button (burger) visibility not reevaluated when orientation changes #24469
base: main
Are you sure you want to change the base?
Conversation
The condition to show the flyout button (burger) or not is set in method ShouldShowToolbarButton of the FlyoutPage. In Android, this method is not hit when orientation changes. This method is only called once during initialization. This modification triggers the update of this button when orientation changes. dotnet#24468
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
+1 |
Temporary fix https://gist.github.com/guyvaio/5ca11a6aa373c1fe486cc9e25137aeec |
We have tried the temporary fix, but it doesn't fix the problem for us. |
Line 212 should be hit when tablet is rotated. |
That line is hit. |
The method invoked by reflection is visible at line 158 of https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/NavigationPage/NavigationPageToolbar.cs Have also a check on the ShouldShowToolbarButton method (if not overriden in your code) : line 181 of https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/FlyoutPage/FlyoutPage.cs |
We did a simple fix for this. Maybe not the nicest and cleanest solution, but it make it work and the menu button is always visible when it should. Flyout = new ContentPage();
Flyout.SizeChanged += Flyout_SizeChanged;
public override bool ShouldShowToolbarButton()
{
#if ANDROID
return true;
#else
return base.ShouldShowToolbarButton();
#endif
} |
The condition to show the flyout button (burger) or not is set in method ShouldShowToolbarButton of the FlyoutPage. In Android, this method is not hit when orientation changes. This method is only called once during initialization.
This modification triggers the update of this button when orientation changes.
#24468