Search code examples
androidcordovasplash-screen

Animated splash screen using .gif


I want to use animated gif for the Splash screen. So I change the src in config.xml into my gif like this:

...
<gap:splash gap:density="xhdpi" gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.gif" />
...

But when it runs, the gif image is not animating and only show the first frame.

I have another gif inside the app and it animates well. So I guess the one in splash screen is not WebView?

Is there a way to use gif for splash screen other than customizing the Android Java code?

Thanks


Solution

  • In webview .gif works well. In other cases it does not work in android. You need to customize android java code to make it work. But their is an alternative.

    If you have the images for all frames (you may also extract them from gif) and use android animation on the images. It will look like gif image only. All i mean is that you can do frame anmations.

    This link will give you some idea:

    http://mobile.tutsplus.com/tutorials/android/android-sdk-quick-tip-creating-frame-animations/

    You may google more to find better tutorial. This kind animation works very well.