Nativescript旋转动画无限迭代不起作用

vin*_*ain 2 javascript android webview typescript nativescript

我想通过无限迭代旋转标签,目前它在 iOS 设备上运行良好,但在 android 上它只旋转 2 秒然后停止。

下面是我的 CSS 代码

.fas {
    font-family: "Font Awesome 5 Free", "fa-solid-900";
    font-weight: 900;
}

.spin {
    animation-name: rotate;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
Run Code Online (Sandbox Code Playgroud)
<Label text="rotate value" class="fas spin"></Label>
Run Code Online (Sandbox Code Playgroud)

Man*_*noj 14

我不确定它是否是一个错误,不能期望 {N} 与浏览器内联,因为我们在这里处理本机元素。下面的黑客似乎有效,

@keyframes rotate {
    0% {transform: rotate(0deg);}
    99.9% {transform: rotate(360deg);}
    100% {transform: rotate(0deg);}
}
Run Code Online (Sandbox Code Playgroud)