-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
White screen after splash screen #960
Comments
The splash screen is configured to dismiss after 3 seconds, so it will disappear and show the webview, which might be white depending on the app. In next release there will be a new configuration option |
@jcesarmobile I am still having this issue. My app has this config, yet the white webview always blinks before rendering my initial page. I have created a splash screen page with animation and so this blinking white really ruins the affect!
|
@oliverandersencox did you fix this problem? |
Facing the same issue. |
adding "launchShowDuration": 3000 fixed my issue |
I had this issue, I tried several configuration with no result.
|
@ulver2812 I also ended up going with this solution but 500ms works well |
Doesn't work. still having this issue after splash screen. |
still the same issue!! No solution yet? |
Any updates on this. Still the same issue tried all above solutions :) |
I confirm the same issue on vuejs mobile web app. |
inside
|
Is there an official recommendation for this? I just spend 3 hours trying to fix thinking it was an optimization problem on the angular part but no, everything load in the background but after I call |
You could at a background to html like this:
Try to pick a color that is the same as (or close to) your final background color. This is more of a workaround than a real fix, but at least it is a little better than a bright white flash in my opinion. |
@distante I had spent more than 24 hours for this. Just gave up.. This must be fixed by the core team !!! |
@jcesarmobile That options don't work for me. I should try 'FadeSplashScreen' option again! |
What's happening is this: If you call hide when your app is mounted, at that point the web view is fully loaded, but it has not yet performed the first paint. This can take 100 milliseconds or so, so you end up seeing a blank web view briefly. The solution to add a short delay (200 milliseconds or so) before actually calling SplashScreen.hide(). // At the point at which your app is fully mounted
setTimeout(() => { Splash.hide(); }, 150); |
Uhmm, so using like |
Good idea! Put this in the main .js file. document.addEventListener('DOMContentLoaded', async () => {
const splashscreen = Plugins.SplashScreen as SplashScreenPluginWeb;
await splashscreen.hide();
}); |
Thanks for the tip @distante, I have added |
Only using The most foolproof way would be the following:
So in the end you will end up with something like this: html {
background: #000; /* or any other color */
} window.addEventListener('DOMContentLoaded', () => {
setTimeout(() => {
SplashScreen.hide({
fadeOutDuration: 250,
});
}, 250); // this could range from 0 to probably no more than 2000, just experiment a little
}); |
What I did was to set an observable in my home page that emits each time my home is checked by angular: Home Page:
then, I subscribe to it and I wait until it does not emit anything in 100ms (so when it is stable)
I just hide the splashscreen the first time As an extra info, I use all my components with |
@tafelnl I went back and read the documentation on the DOMContentLoaded event, it turns out the window 'load' event is a better choice, because that is not fire until all dependent resources have been loaded (e.g. stylesheets and images), whereas DOMContentLoaded is fired when only the DOM has been loaded. |
You can change the color in
You don't need download the extra package "@capacitor/SplashScreen" lol. Disclaimers: I'm speaking for Capacitor v3 and Ionic v5 |
I have tried everything its still appears as a white screen can anyone help ? |
Same here using ionic 6, capacitor 3.5.1. Large loading time in white screen on Android after splash screen |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Capacitor displays my custom splash screen as normal, however it will always display a white screen next, before finally navigating to the first route page.
Routing module:
const routes: Routes = [ { path: '', redirectTo: '/welcome', pathMatch: 'full' }, { path: 'app', loadChildren: './pages/tabs/tabs.module#TabsPageModule', canActivate: [AuthGuardService] }, { path: 'welcome', loadChildren: './pages/welcome/welcome.module#WelcomePageModule' }, ]
It is not a nice look for the app. Is there a particular reason it does this? Maybe something to do with the lazy loading?
The text was updated successfully, but these errors were encountered: