0

After some discussion on Implementing-own-splashscreen-in-maui-not-working in which I got the point that what I was trying to do, unfortunately can't be reached, I thought it is better to open a new topic with a different subject.

So, my question now is how I could get rid of the SplashScreen in .NET MAUI and don't show any? Commenting out the following section in my App-Project did not help:

<ItemGroup>
    ...
    <!-- Splash Screen -->
    <!--<MauiSplashScreen Include="Resources\Splash\dotnet_bot.svg" Color="#512BD4" BaseSize="128,128" />-->    
    ...
</ItemGroup>

Is there a way to get rid of a SplashScreen completely? My App should be working on iOS and Android Devices and I am currently working with the Emulator Pixel 5 - API 33 (Android 13.0 - API 33)

OXO
  • 391
  • 1
  • 8
  • What is supposed to be happening then while the app is starting up? – Julian Mar 26 '23 at 07:35
  • Well, actually show my own then But in the other Thread it turned out that before my own, I can still see the standard SplashScreen and this I want to prevent – OXO Mar 26 '23 at 07:41
  • Maybe this helps then: https://stackoverflow.com/q/74491174/4308455 – Julian Mar 26 '23 at 08:40
  • @OXO "How do you remove dot net splash screen" - the same question asked a while ago: https://stackoverflow.com/questions/75782857/how-do-you-remove-dot-net-maui-splash-screen – H.A.H. Mar 26 '23 at 13:00
  • You cant get rid of the splash screen. BUT you can do a trick. Create a 1x1 png transparent image. So the image will not be shown on MauiSplashScreen. Then, load your new contentpage splash screen with the same background color containing your app logo, animation, version etc. You do have to hide tab bar and navigation to your splash screen. You can auto-navigate from your main page to the custom launch screen instantly. The impact will be to launch the app, the user will see a solid background color (eg purple) and in seconds will see the real launch screen. – Isidoros Moulas Mar 26 '23 at 21:29
  • Also look at this https://stackoverflow.com/questions/74884712/splash-screen-with-version-in-maui – Isidoros Moulas Mar 26 '23 at 21:35
  • @IsidorosMoulas - okay also a good idea, but how can I switch to my own Splash instantly? Currently, I could also remove the Image for the standard Splash, then we have just a purple background for long time and then it switches to my own Screen. In case I could Switch to my own instantly that would compensate my problem. In addition to that, it might also be possible to have the same background color for the standard splash screen as it would be for my own, so it could not be that different. I think it is an interesting idea, but how switch directly? ‍♂️ – OXO Mar 27 '23 at 04:19
  • You can go to your custom splash page from the AppShell(), just add Navigation.PushAsync(new CustomSplashPage()); When the custom splash page finishes the work, then pop to root or goto async to another page (eg privacy page). – Isidoros Moulas Mar 27 '23 at 11:03

1 Answers1

0

From the android 12, the android will use the SplashScreen Api to show the splash screen. And according to this case about disable Android 12 default splash screen, from Android 12, it's not possible to opt out of the splash screen. It is only possible to customize it: icon, window background, exit animation.

So you should custom the splashscreen instead of disabling it. I have create new Theme below the /Platforms/Android/Resource/values/styles.xml to make the MainActivity use it. But the Splash Screen will be white blank background.

In addition, I check your old question and found that you want to set the image as the splash screen's background. You can't achieve that because this is the native android limit from the Android 12. You can refer to this case about How to set a drawable as a windowSplashScreenBackground parameter in the new SplashScreen API?

Liyun Zhang - MSFT
  • 8,271
  • 1
  • 2
  • 14