question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Splash Screen scaling displays twice

See original GitHub issue

Description of the problem: I followed the instructions to configure splash screen scaling described here: https://capacitor.ionicframework.com/docs/apis/splash-screen/#configuration. When the app launches, Capacitor displays my splash screen scaled incorrectly, then adjusts to the scaling I have in my capacitor.config.json file:

"plugins": {
    "SplashScreen": {
      "launchShowDuration": 1000,
      "launchAutoHide": true,
      "androidSplashResourceName": "splash",
      "androidScaleType": "CENTER_CROP"
    }
  },

What I’m expecting is that the splash screen displays once, at the specified scale.

Affected platform

  • Android
  • iOS
  • electron
  • web

OS of the development machine

  • Windows
  • macOS
  • linux

Other information:

Capacitor version: 5.0 node version: 10.15.3 npm version: 6.9.0 CocoaPods version:

Steps to reproduce: As described above.

Link to sample project:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:64 (10 by maintainers)

github_iconTop GitHub Comments

122reactions
Nuajancommented, May 25, 2020

Hi, having the same issue and digged on Ionic Forums and find the following. Just appying as follows it did the job for me, without setting up a color as @peterpeterparker said (it also works but this seems to do the trick on a better way). Check it out.

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsTranslucent">true</item> </style>

By the way, i also agree such a simple thing to be so frustating. Maybe not the worst issue on an app but, if all customers have a similarity all around the world is for putting their eyes in such little things - just opening the app - before all the incredible effort behind the scenes.

Regards.

41reactions
peterpeterparkercommented, Dec 31, 2019

Instead of removing android:theme="@style/AppTheme.NoActionBarLaunch" as @jcesarmobile suggested, which would display a grey screen before booting your splash, I suggest to set a color as workaround for this first screen, in my case my splash screen main predominant background.

In file android/app/src/main/res/values/styles.xml modify AppTheme.NoActionBarLaunch with your background color, for example:

<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
  <item name="android:background">#230F29</item>
</style>

Doing so it is at least a bit less flashy

ezgif com-video-to-gif

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic react splash screen is showing two times with capacitor
I added the splash screens with their correct sizes but on app loading splash screens are displayed two times. Find below image, app...
Read more >
SplashScreen shows twice and only hides after three seconds ...
Hello, When I create an Ionic/Angular/Capacitor Project the Splashcreen shows twice (first time its stretched on my 18:9 screen) and the ...
Read more >
Splash Screen appears twice on iPad application
Splash Screen appears twice on iPad application ... Ideally PG would draw the right orientation (and size) while waiting for the WebView to...
Read more >
How to avoid double splash screens in Android 12?
Here, if you notice, 2 splash screens appear. The first one is generated by the Android 12 OS, and the second one is...
Read more >
Migrate your existing splash screen implementation to Android ...
If you have previously implemented a custom splash screen in Android 11 or lower, you'll need to migrate your app to the SplashScreen...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found