-
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
White screen when changing the main page #26845
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
Hi, <style name="XXX" parent="Maui.MainTheme.NoActionBar">
<item name="android:windowBackground">@color/YYY</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowTranslucentStatus">false</item>
</style> You have to replace name and perhaps parent with your values. Also "android:windowBackground". I'm not at work atm so i can't say exactly which item could help. Good luck. |
This issue has been verified Visual Studio 17.13 Preview2.1 (9.0.21 & 9.0.0 & 8.0.100 & 8.0.20). Can repro this issue on Android platform. But works fine on 8.0.14. |
I checked and unfortunately it does not fix the issue, still page blinked |
the issue is exist on 8.0.14 version also |
Hi @Redth, i checked some other sources also somehow related to this topic, f.ex. Maybe you have workaround for this issue also? |
The white blink occurs when setting a new page using the following code: Each time a new root page is assigned, a new layout is inflated, which contains a fragment intended to display the page. However, because Android's fragment manager requires a few milliseconds to commit the transition, a noticeable white blink can be seen during this process. I created a similar setup in Android Studio that mimics the behavior of .NET MAUI. The same white blink issue occurs, confirming that it stems from the fragment manager’s transition delay. https://github.com/kubaflo/Android_Blink_Bug
namespace Maui.Controls.Sample;
public partial class App : Application
{
public App() => InitializeComponent();
protected override Window CreateWindow(IActivationState? activationState) => new Window(new Page1());
}
class Page1 : ContentPage
{
public Page1()
{
BackgroundColor = Color.FromArgb("#009900");
Content = new Button
{
Text = "Open page 2",
VerticalOptions = LayoutOptions.End,
HeightRequest = 40,
Command = new Command(() => Application.Current!.Windows[0].Page = new Page2())
};
}
}
class Page2 : ContentPage
{
public Page2()
{
BackgroundColor = Color.FromArgb("#990000");
Content = new Button
{
Text = "Open page 1",
VerticalOptions = LayoutOptions.End,
HeightRequest = 40,
Command = new Command(() => Application.Current!.Windows[0].Page = new Page1())
};
}
} |
That being said, there's a way of how to fix it 😅 #27361 |
2024-12-27_16-36-48.mp4
Description
White screen when changing the main page, occurs on Android devices.
I organised navigation with modal pages. I open some Modal pages with PushModalAsync, then show first page MainPage = new LoginPage(); to make empty ModalStack and show LoginPage MainPage = new LoginPage()
App shows white screen.
Steps to Reproduce
Steps to Reproduce
Create new NET MAUI app.
Create new Pages.
Switch between pages.( MainPage = new TestPage())
Version with bug
8.0, 9.0
Affected platforms
Android
Link to public reproduction project repository
DXMauiApp5.zip
No response
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
No response
Affected platforms
Android
Affected platform versions
Android
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: