使用css写的动画离开小程序再次回来后消失
发布于 5 年前 作者 guiying92 2048 次浏览 来自 问答

有个动画效果,利用css的keyframes+background-image来写的(base64图片)。

在ios一些设备上出现问题:第一次进入小程序,动画正常显示->离开小程序->再回到小程序->图片没了

wxml:

<view class=“icon”></view>

wxss:

.icon {

    width: 24px;

    height: 24px;

    animation: playing 0.8s linear 0s infinite;

    background-size: contain;

}

@keyframes playing {

    0% {

        background: no-repeat center/contain url(data:image/png;xxx);

    }

    100% {

        background: no-repeat center/contain url(data:image/png;base64,xxx);

    }

}

1 回复

提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

回到顶部