删除出现在启动屏幕之前的白屏

时间:2019-07-15 12:43:40

标签: html css angular ionic-framework

我正在使用ionic4 / angular,但有两个问题。我在单独的页面中创建了一个启动画面(动画徽标)。当我打开该应用程序时,在启动屏幕(单独页面)加载之前,白色屏幕会闪烁。我隐藏了启动画面。当我对此进行研究时,发现发生这种情况是因为应用程序本身需要花费一些时间来加载。提出实现此目的的另一种方法。

我的第二个问题是在加载徽标时出现一小行。部署在实际设备上时会出现此问题,但是当我在模拟器和本地主机上运行时,此问题非常完美。细线看起来像这样:

enter image description here

但是不应该那样。

ion-content{
    --background:#FFBF00;
}
img{
    padding-bottom: 1px;
}

.tree {
    left: 0;
    right: 5%;
    margin:0 auto;
    top:50%;
    transform:translateY(-50%);
    width: 100%;
    position: absolute;
}

.tree > div {
    position: absolute;
    height: 100%;
    width: 100%;
    background: #FFBF00;
    top: 0;
    left: 0;
    -webkit-animation-name: hello;
    -webkit-animation-duration: 5s;
    -webkit-animation-fill-mode: forwards;
    animation-name: hello;
    animation-duration: 5s;
    animation-fill-mode: forwards;
}

@keyframes hello {
    0% {
        height: 100%;
    }
    100% {
        height: 0%;
    }
}

@-webkit-keyframes hello {
    0% {
        height: 100%;
    }
    100% {
        height: 0%;
    }
}
<ion-content>
<div class="tree" text-center>
    <div></div>
    <img src="assets/logo.svg">
  </div>

</ion-content>

1 个答案:

答案 0 :(得分:0)

您应在YourAppFiles/resources中将初始屏幕的非动画版本设置为splash.png(必须至少为2732×2732px),然后运行命令ionic cordova ressources解决第一个问题

第二个问题可能是由您如何制作此“第二个启动画面”引起的,但没有更多代码,我无能为力