我想在启动屏幕中添加gif图像,但这不是wokring。我使用的是离子版本5.0.7如果有人知道,请帮忙。
最好在启动屏幕中使用Lottie制作动画。
安装:
ionic cordova plugin add cordova-plugin-lottie-splashscreen
npm install @ionic-native/lottie-splash-screen
代码:
import { LottieSplashScreen } from '@ionic-native/lottie-splash-screen/ngx';
constructor(private lottieSplashScreen: LottieSplashScreen) { }
...
this.lottieSplashScreen.show('www/lottie/animation.json', false, 1024, 768)
.then((res: any) => console.log(res))
.catch((error: any) => console.error(error));
请参阅此处的示例