3

Not sure if this could be a bug or what

If I set the splashscreen color it only works if the theme is Light. For the Dark theme it stays black. You see the image with a white background though. This is now for Android.

<MauiSplashScreen Include="Resources\Splash\logo.svg" Color="White" />

Updates to this question:

I have implemented the solution at

https://ewerspej.hashnode.dev/lets-customize-the-splash-screen-of-a-maui-app#heading-light-mode

It works for Light Mode as expected, but for Dark Mode the colorPrimaryDark is ignored. There is always this black frame around the logo. The logo's background is set to Transparent and still the logo has a background of White with the black frame around it.

I am doing this for Android (for now) and I am not using the Emulator but my Xioami Redmi Note 10 Pro. The device runs Android 12 and MIUI 13.016. All updated. The API is API 31 - Which I guess could be the issue.

I have also searched for any possibility of black and tried to change it. Problem still persist.

I would like the image and the background to be white in Dark or Light theme.

If I could just disable dark mode for the app that would be great.

Below a screenshot of what I see in Dark Mode.

enter image description here

Thanks!

Jaco

12
  • Which .NET version are you working with? Have you searched for other questions on the topic and did you check if an issue was reported in the MAUI GitHub repository? Commented Mar 19, 2023 at 16:10
  • .NET 7. Searched extensively and checked GitHub but couldn't find the issue. Similar issues but not the one I am struggling with. Commented Mar 19, 2023 at 17:26
  • Can you please show more of your code in the question? Did you make any changes to the MainActivity.cs in the Android-specific folder? What changes did you make compared the default app template? Please also add a screenshot of what it looks like at the moment and describe how you would like it to look. Commented Mar 20, 2023 at 8:42
  • I cannot reproduce the issue with a new MAUI app project, it works as expected - I get the same color for Dark and Light mode. Which Android version are you on? I know that the splash screen doesn't work properly with API 31, but more recent versions work fine. Commented Mar 20, 2023 at 9:08
  • Thanks. I have given more info in the question above. I guess the problem could be API 31. Not sure how to upgrade it Commented Mar 20, 2023 at 10:40

1 Answer 1

-1

You can set the Maui Splashscreen for the windows platform by using this method.

open the Package.appxmanifest file in the Platform->Windows folder. Then you can change the splashscreen for the Windows paltform.

Sign up to request clarification or add additional context in comments.

1 Comment

The OP is asking specifically for Android.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.