Splash Screen scaling displays twice
See original GitHub issueDescription 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:
- Created 4 years ago
- Reactions:17
- Comments:64 (10 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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
modifyAppTheme.NoActionBarLaunch
with your background color, for example:Doing so it is at least a bit less flashy