gpt4 book ai didi

android - 闪屏 Ionic 中的 GIF 文件

转载 作者:技术小花猫 更新时间:2023-10-29 10:38:53 27 4
gpt4 key购买 nike

我正在使用 ionic-framework 和 Cordova 插件开发混合应用程序。他们问我两个操作系统(iOS 和 Android)上的启动画面都有一个小动画。我想象一个 GIF,但如果您可以将 GIF 作为初始屏幕加载,则不会。或者如果有一个插件。

最佳答案

您可以在不使用插件的情况下这样做。 More information is available here .

HTML

 <body>
<div id="custom-overlay"><img src="http://cdn.osxdaily.com/wp-content/uploads/2013/07/dancing-banana.gif"></div>
<!-- Here comes rest of the content -->
</body>

www/css/style.css

#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;
}

www/js/app.js

 .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);
});
});

关于android - 闪屏 Ionic 中的 GIF 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31349581/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com