2

I have a Xamarin forms application and I have requirement to change the iOS splash page image (.png) configured in the LauchScreen.storyboard file based on a build compilation symbol. (ie, If the build configuration symbol "TEST-ENVIRONMENT" is defined, then display image-1.png on the splash page otherwise use image-2.png). I thought maybe I could swap images by specifying a command to copy the appropriate image file in the Pre-build event but since they are Embedded Resources, I don't see how it could be done. I'm at a loss as to how I can do this.

Thanks!

1 Answers1

0

No, I don't think you can change the image in the LaunchScreen.storyboard at run time.

You can't assign a custom class to LaunchScreen.storyboard.

When launch screen image is being displayed, your app is in the loading state and you can't execute any code at that point.

The way I recommend you to do is create two LauchScreen.storyboard files for different configuration symbol and before you build your project, choose the right LauchScreen.storyboard file to build.

Refer: execute-code-in-launch-screen

in-ios-how-to-change-launchscreen-image-according-environment-dev-hom-prod

nevermore
  • 15,432
  • 1
  • 12
  • 30