Christian Findlay
Christian Findlay

Reputation: 7692

UWP Customized Splash Screen Sample

I want to create a splash screen in UWP. I want do more than just center an image in the screen. I thought it would be a lot more straight forward. I saw these articles:

https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh868191(v=win.10)

https://code.msdn.microsoft.com/windowsapps/Splash-Screen-in-Universal-42c0b57a

When I first opened up this sample, I thought that it worked... But, it doesn't actually do anything. It's actually just a furphy. If you look carefully at the screen, it actually just shows an image (defined in the manifest) for a second or two as the app is starting up, and then when the app is loaded, it switches to the extended screen with a progress ring. I've seen samples where people turn on the splash screen image, but that's not want I need to achieve. Part of the problem is that UWP app startup time is terrible even on fast machines. Even blank apps with nothing in them take several seconds to start up.

Is there a UWP sample floating around that actually a) cuts out the splash image from the manifest, and b) allows us to replace it with something else?

Note: I do not wish to remove the splash screen. I want to customize it.

Upvotes: 0

Views: 2028

Answers (1)

Martin Zikmund
Martin Zikmund

Reputation: 39092

The main splash screen (centered splash screen image defined in the package.appxmanifest) will always be displayed unless you make it optional - while even in this case it will be shown to the user when the app doesn't load immediately.

To make the splash screen optional, you have to open the manifest file as XML, add the following namespace declaration:

<Package
  ...
  xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5">

And then add the uap5:optional attribute to your splash screen:

<uap:SplashScreen ... uap5:Optional="true" />

You can implement an extended splash screen, which is described in the articles you linked. If you postpone all initialization for the extended splash screen, it is quite likely that the optional default splash screen will not display at all.

However, although the samples only show the same image with progress ring, you can put any content you want on the extended splash screen, you are in full control of it because it is a normal Page.

Upvotes: 2

Related Questions