Android 启动屏幕中的GIF文件
我正在用ionic框架和Cordova插件开发一个混合应用程序。他们问我两种操作系统(iOS和Android)的启动屏幕都有一个小动画。我想象一个GIF,但如果你能加载一个GIF作为启动屏幕,那就不是了。或者如果有插件的话。你可以不用插件就这样做 HTML www/js/app.jsAndroid 启动屏幕中的GIF文件,android,ios,ionic-framework,cordova-plugins,Android,Ios,Ionic Framework,Cordova Plugins,我正在用ionic框架和Cordova插件开发一个混合应用程序。他们问我两种操作系统(iOS和Android)的启动屏幕都有一个小动画。我想象一个GIF,但如果你能加载一个GIF作为启动屏幕,那就不是了。或者如果有插件的话。你可以不用插件就这样做 HTML www/js/app.js .run(function($ionicPlatform, $state, $cordovaSplashscreen) { $ionicPlatform.ready(function() {
.run(function($ionicPlatform, $state, $cordovaSplashscreen) {
$ionicPlatform.ready(function() {
if(navigator.splashscreen) {
$cordovaSplashscreen.hide();
}
});
});
.controller('ListCtrl', function($scope) {
$scope.$on('$ionicView.afterEnter', function(){
setTimeout(function(){
document.getElementById("custom-overlay").style.display = "none";
}, 3000);
});
});
如果您想在屏幕中包含gif,那么您可以参考此链接。嗨,如果您能够实现,请共享答案。您好,在我的情况下,假设我实现了您的代码:-此启动加载,-ListCtrl页面将显示短时间(毫秒)-自定义启动屏幕显示-列表Ctrl页面显示。
#custom-overlay {
display: flex;
flex-direction: column;
justify-content: center;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 100;
background-color: #fe201f;
}
#custom-overlay img {
display: block;
margin: 0 auto;
width: 60%;
height: auto;
}
.run(function($ionicPlatform, $state, $cordovaSplashscreen) {
$ionicPlatform.ready(function() {
if(navigator.splashscreen) {
$cordovaSplashscreen.hide();
}
});
});
.controller('ListCtrl', function($scope) {
$scope.$on('$ionicView.afterEnter', function(){
setTimeout(function(){
document.getElementById("custom-overlay").style.display = "none";
}, 3000);
});
});