【发布时间】:2021-04-23 00:17:38
【问题描述】:
我需要什么:应用打开时显示的动画闪屏。
我做了什么:我将下面的视频作为参考 https://www.youtube.com/watch?v=-c0htV-kfm8 并添加到下面的代码中,而不是动画启动屏幕,我只得到正常的默认启动屏幕。
鳕鱼e:
<ion-app>
<div #customOverlay><img src="http://cdn.osxdaily.com/wp-content/uploads/2013/07/dancing-banana.gif" [hidden]="!splash">
</div>
<ion-router-outlet [hidden]="splash"></ion-router-outlet>
</ion-app>
.ts 代码
splash = true;
@ViewChild('customOverlay',{static:false})customOverlay:ElementRef;
constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar
) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
setTimeout(function(){
this.splash = false;
this.customOverlay.nativeElement.style.display = 'none';
}, 3000);
});
}
**Config.xml**
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="0" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="none" />
<preference name="SplashScreenDelay" value="0" />
有什么建议吗?
【问题讨论】:
-
是特定于操作系统还是根本不工作?
-
@TaylorRahul 根本不适合我,我正在安卓上测试它
-
你好@dexter请试一试......i.diawi.com/874xgH
-
我尝试关注视频 .. 它对我有用...如果您认为这是有效的。我们会修复它
-
您有机会安装我与您共享链接的演示应用吗
标签: javascript angular ionic-framework ionic4