Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing Splash screen spinner in ionic

I want to show spinner on splash screen using ionic framework in android.Here is my config file:

<content src="index.html"/>
  <access origin="*"/>
  <preference name="splashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="10000"/>
  <preference name="AutoHideSplashScreen" value="false"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="SplashScreen" value="screen"/>

   <preference name="ShowSplashScreenSpinner" value="true"/>
  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true"/>
  </feature>
like image 806
Karan Kumar Avatar asked Oct 30 '22 18:10

Karan Kumar


2 Answers

use

<preference name="ShowSplashScreenSpinner" value="true" />  

in your config.xml

like image 89
Guilherme Zordan Avatar answered Nov 15 '22 05:11

Guilherme Zordan


  1. Install splash screen plugin

$ ionic plugin add org.apache.cordova.splashscreen

  1. Change the defaults.xml in myapp/platforms/ios/cordova/ and config.xml
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="false" />
  1. Add in your controllers.js on top

angular.module('starter.controllers', [])

.run(function($ionicPlatform) { $ionicPlatform.ready(function() { setTimeout(function() { navigator.splashscreen.hide(); }, 300); }); })

  1. Rebuild and run the app:

ios

$ ionic cordova build ios Or $ ionic cordova run ios

Android

$ ionic cordova build android Or $ ionic cordova run android

For Details

like image 41
Loveneet Singh Avatar answered Nov 15 '22 06:11

Loveneet Singh