简体   繁体   English

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

[英]Nativescript rotate animation with infinite iteration not working

I want to rotate label with infinite iteration, currently it is working fine on iOS devices but on android it only rotates for 2 sec and then stop.我想通过无限迭代旋转标签,目前它在 iOS 设备上运行良好,但在 android 上它只旋转 2 秒然后停止。

Below is my CSS code下面是我的 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); } }
 <Label text="rotate value" class="fas spin"></Label>

I'm not sure if its a bug, can't expect {N} to be inline with Browsers as we are dealing with native elements here.我不确定它是否是一个错误,不能期望 {N} 与浏览器内联,因为我们在这里处理本机元素。 The hack below seems to work,下面的黑客似乎有效,

@keyframes rotate {
    0% {transform: rotate(0deg);}
    99.9% {transform: rotate(360deg);}
    100% {transform: rotate(0deg);}
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM