Xamarin.forms: [Bug] [Android] White flash when replacing Current.MainPage with MasterDetailPage

Created on 8 Nov 2019  路  13Comments  路  Source: xamarin/Xamarin.Forms

Description

When replacing the current page with an MasterDetailPage, the screen flashes white between the pages.

Steps to Reproduce

  1. Create a new Blank XF project, set MainPage.BackgroundColor to something not white
  2. Add an MasterDetailPage using the XF template, that adds an Detail page inside a NavigationPage.
  3. Set the MasterDetailPageDetail.BackgroundCOlor to something not white
  4. On the first page, replace it with the MasterDetailPage = App.Current.MainPage = new MasterDetailPage1();

Expected Behavior

The transition between pages should be seamless

Actual Behavior

Before the MasterDetailPage appears, there is a white flash

Basic Information

  • Version with issue: 4.3.0.908675, 4.4.0.936621-pre1
  • Last known good version: 4.2.0.910310
  • IDE: VS2019 16.3.7 / VS2019 16.4.0 Preview 3
4.3.0 5 regression high impact Android bug

Most helpful comment

Hello I am not using MDP. This issue does not occurs just MasterDetailPage. I think problem source is NavigationPage. My XF version is 4.5.0.617

@kerbooo
I had that issue with NavigationPage and realised that it was because I was setting background colors for ContentPages but not NavigationPages. It worked fine once I added to Application.Resources an implicit style

<Style TargetType="{x:Type NavigationPage}">
    <Setter Property="BackgroundColor" Value="{DynamicResource AppBackgroundColor}" />
</Style>

Maybe that is your issue?

All 13 comments

@leo-mck Are you seeing this on a particular platform, or on all of them?

Sorry, I am seeing this on android.

I believe it is the Android window color that shows through, since setting the appropriate Android style like <item name="android:windowBackground">@color/window_background</item> "fixes" it. It's only a useful workaround if your pages have the same background color.

Same issue is for me too.

Hello all, this bug is fix or not? I have tried 4.5 pre release of XF but problem still continues. I am using prism forms for MVVM pattern. I would like to know that is XF bug or prism forms? Thank you in advance

Any update on this bug? I have the same issue while switching the main page, an intermediate white screen shown in between.

@samhouts is there any feedback on this issue?

Its only effecting Android though

We've fixed this one multiple times. I wonder how it keeps coming back.... https://github.com/xamarin/Xamarin.Forms/pull/3283

Hello I am not using MDP. This issue does not occurs just MasterDetailPage. I think problem source is NavigationPage. My XF version is 4.5.0.617

Hello I am not using MDP. This issue does not occurs just MasterDetailPage. I think problem source is NavigationPage. My XF version is 4.5.0.617

@kerbooo
I had that issue with NavigationPage and realised that it was because I was setting background colors for ContentPages but not NavigationPages. It worked fine once I added to Application.Resources an implicit style

<Style TargetType="{x:Type NavigationPage}">
    <Setter Property="BackgroundColor" Value="{DynamicResource AppBackgroundColor}" />
</Style>

Maybe that is your issue?

I believe it is the Android window color that shows through, since setting the appropriate Android style like <item name="android:windowBackground">@color/window_background</item> "fixes" it. It's only a useful workaround if your pages have the same background color.

This fixes it, thanks a lot.

Hello I am not using MDP. This issue does not occurs just MasterDetailPage. I think problem source is NavigationPage. My XF version is 4.5.0.617

@kerbooo
I had that issue with NavigationPage and realised that it was because I was setting background colors for ContentPages but not NavigationPages. It worked fine once I added to Application.Resources an implicit style

<Style TargetType="{x:Type NavigationPage}">
    <Setter Property="BackgroundColor" Value="{DynamicResource AppBackgroundColor}" />
</Style>

Maybe that is your issue?

This helped me, thank you soooooo much, this issue has been a personal headache for AGES. you're an absolute life saver! It might just be a work around, but it definitely makes a huge difference.

@Deijin27 GENIUS! Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings