Ionic 3 long white screen after splash - ionic-framework

Is there a way to get it as soon as i start my application and after that i get the login screen, and get ride of the SplashScreen.
Or a way to modify something so my animation become my SplashScreen ?
Thank you.

Put a longer timeout in your config.xml and disable it yourself when your home screen is loaded.
config.xml
<preference name="SplashScreenDelay" value="30000" />
app.component.ts
platform.ready().then(() => {
splashScreen.hide();
});

Ionic hides the splash screen as default, so if the splash is hidden but the main application is not ready yet or the home page still loads some data, you will find the white screen!.
The suggested solution (control hiding the splash screen):
Disable hiding the splash screen by default from config preferences.
Hide it manually splashScreen.hide(); when you want to hide it
either when the platform is ready or inside the home page controller.
config.xml
<preference name="AutoHideSplashScreen" value="false" />
app.component.ts OR home.page.ts
platform.ready().then(() => {
splashScreen.hide();
});

You can run/ build your application in production mode.
For Android Build, e.g: ionic cordova build android --prod
For Android Run, e.g: ionic cordova run android --prod
Build using ionic cordova cli
Run using ionic cordova cli

The best Solution I tested now is :
config.xml:
//Put a long time for splash screen delay to avoid that the splash screen hides and the interface become white:
<preference name="SplashScreenDelay" value="50000" />
//just animation duration before being hided
<preference name="FadeSplashScreenDuration" value="800" />
app.component.ts
constructor(
public platform: Platform,
public statusBar: StatusBar,
public splashScreen: SplashScreen
){
// ensure that the interface is loaded by adding 500ms or less before hiding the splash screen manually
this.platform.ready().then(() => {
setTimeout(() => {
this.splashScreen.hide();
}, 500);
});
}

Related

change status bar color during splash screen in ionic 3

I already used
cordova-plugin-splashscreen
and in config.xml
<preference name="SplashStatusBarBackgroundColor" value="#b83500" />
<preference name="SplashNavigationBarBackgroundColor" value="#b83500" />
<platform name="android">
...
</platform>
it is not work
and in component.ts
this.statusBar.backgroundColorByHexString('#b83500');
but it change after splash screen.
so, how can i change status bar color during splash screen.
Remove the splash screen plugin and install this version of the plugin from
ionic cordova plugin rm cordova-plugin-splashscreen
ionic cordova plugin add https://github.com/goinnn/cordova-plugin-splashscreen.git#4.0.0#colors
Following this you can then add the preferences in you configx.xml file as you have already mentioned. However, do place them in the android section
<platform name="android">
<preference name="SplashStatusBarBackgroundColor" value="#b83500" />
<preference name="SplashNavigationBarBackgroundColor" value="#b83500" />
...
</platform>
This will solve you issue.
Do keep in mind this will cause issues with the ios version as this is an older version of the plugin itself. It however works perfectly on android.
This will only change color of status bar on splash screen. To keep the color changed you need to keep the following code in your app.component.ts file.
this.statusBar.backgroundColorByHexString('#b83500');
For Android, add following in styles.xml (I'm showing status bar with white background)
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
<item name="android:statusBarColor">#android:color/white</item>
</style>
<style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
<item name="android:statusBarColor">#android:color/white</item>
</style>

White screen after splash screen in IONIC app

I have a "problem" with my app. When it's running, after the splash screen and before the app is ready, a white screen appears for about 5/6 seconds and it's so annoying.
How is it possible to avoid this white screen?
I didn't see a lot of questions about this (without working answers) and I would like to have an updated answer. I don't post code because I don't know which code could be useful.
Ionic version 3.13.2
Thank you.
This may be due to the fact that your application takes longer to load than the duration of the splahscreen.
In your config.xml file you may have something like:
<preference name="SplashScreenDelay" value="3000" />
That means that the splashscreen will automatically fade out after 3 seconds. However, if your app is not ready after that time, you will see a white screen while your app finishes loading.
The solution is to set a longer time for your splashscreen and to also turn off AutohideSplashScreen. In the config.xml file:
<preference name="AutohideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="30000" />
Then you need to make sure that you turn the splashscreen off from inside your app, as soon as your app is ready.
Typically in the app.component.ts class constructor:
this.platform.ready().then(() => {
this.splashScreen.hide();
});

Remove loading spinner from splash screen in ionic

Hello I'm building an app with Ionic, and I want to remove the loading spinner on splash screen when the app starts, any solution for this?
Add this to your config.xml-file:
<preference name="ShowSplashScreenSpinner" value="false" />
Here are som more preferences you can make use of.

Ionic 2 - Change color at the top of the screen

I built an app with Ionic 2 for Android.
I would like to know if it is possible with Ionic 2 to change the color that is at the top of the smartphone screen.
For example, in the Whatsapp image the top of the screen is green, and in my app it is black. I would like to switch to a lighter red, is this possible?
In your config.xml which is present in root of your project change these lines or add if not there.
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="your color" />
You can achieve this by setting the color of the statusbar.
Put this into your platform.ready block:
platform.ready().then(() => {
StatusBar.backgroundColorByHexString("#34af23"); //change this to your color
}
Probably you also need to import StatusBar from ionic-native:
import { StatusBar } from 'ionic-native';

Splash screen duration does not change

I have an Apache Cordova project using VS2015 and am using the Ionic framework.
My config.xml includes the following:
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
However I only see the splash screen for a very brief duration (maybe 1/2 a second) when deploying to an iOS device.
Is there some other implementation that is required for splash screens to appear for the time specified by 'SplashScreenDelay'?
Have u tried in in an emulator it might me a one off issue with the device.I would recoment using the GennyMotion emulator.
If you are setting up the splash screen using the cli i would recommend this tutorial and video here
http://pointdeveloper.com/how-to-add-splash-screen-for-ionic-framework-apps/