【问题标题】:remove white screen which appears before splash screen删除在启动画面之前出现的白屏
【发布时间】:2019-11-24 04:08:55
【问题描述】:

我正在使用 ionic4/angular,但有 2 个问题。我在单独的页面中创建了一个启动画面(动画徽标)。当我打开应用程序时,在启动画面(单独的页面)加载之前会出现一个白屏。我隐藏了启动画面。当我对此进行研究时,我发现它的发生是因为应用程序本身需要时间来加载。建议一种替代方法来实现同样的目标。

我的第二个问题是加载徽标时出现一条小线。部署在真实设备上时会出现此问题,但当我在模拟器和本地主机上运行时它是完美的。小线如下所示:

但不应该是这样的。

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>

【问题讨论】:

    标签: html css angular ionic-framework


    【解决方案1】:

    你应该在YourAppFiles/resources作为splash.png(它必须至少是2732×2732px)中放置一个非动画版本的闪屏,然后运行命令ionic cordova ressources来解决第一个问题。

    第二个问题可能是由你如何制作这个“第二个闪屏”引起的,但没有更多代码,我帮不了你

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-29
      • 2012-12-27
      • 2017-05-23
      • 1970-01-01
      • 1970-01-01
      • 2022-01-14
      • 2021-03-17
      • 1970-01-01
      相关资源
      最近更新 更多