Open cat0363 opened 1 year ago
I have uploaded the code for this issue to github. https://github.com/cat0363/Maui-Issue13810
This problem does not occur if you use Shell as follows.
[App.xaml.cs]
public App()
{
InitializeComponent();
MainPage = new AppShell();
}
[Page1.xaml.cs]
private async void Button_Clicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new Page2(), false);
}
[Page2.xaml.cs]
private async void Button_Clicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PopAsync(false);
}
Since there is no problem with Shell, it is a problem only with NavigationPage. From the above, there is no problem with Shell's Navigation. Since changing from NavigationPage to Shell involves a significant change, I hope that this problem will be resolved.
At first glance, issue seems minor, but it's major if you have your page background color to something else than white. In your sample, for page2 I set BackgroundColor to Pink, so on pop from page2, app shows pink color for a 1-2 seconds.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 1.0. Can repro on android platform with sample project. https://github.com/cat0363/Maui-Issue13810
Verified this issue with Visual Studio 17.7.5. Repro on Android platform.
I am also experiencing this on Android, iOS is fine. Not using shell. Disabling animation while navigating seems to work in my case, but its not as nice.
Got the idea from https://github.com/xamarin/Xamarin.Forms/issues/8581#issuecomment-557104526
Is there any workaround?
Discussed in https://github.com/dotnet/maui/discussions/13809