[英]Scale animation on Xamarin.Forms UWP not repeating
我正在嘗試在我的圖像上設置類似於https://daneden.github.io/animate.css/上的pulse的動畫
因此,在Xamarin.Forms中,我嘗試使用ViewTotensions類的ScaleTo重新創建該動畫:
await image.ScaleTo (1.3, 500);
await image.ScaleTo (1, 500);
await image.ScaleTo (1.3, 500);
await image.ScaleTo (1, 500);
但是實際上什么都沒有,我的形象保持不變。
我該如何解決?
謝謝你的幫助。
我會將CSS脈沖轉換為自定義的父/子動畫。
//animation-duration: 1s;
@keyframes pulse {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
50% {
-webkit-transform: scale3d(1.05, 1.05, 1.05);
transform: scale3d(1.05, 1.05, 1.05);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
new Animation
{
{ 0, 0.5, new Animation (v => image.Scale = v, 1, 1.05) },
{ 0.5, 1, new Animation (v => image.Scale = v, 1.05, 1) },
}.Commit(this, "viewAnim", 16, 1000, Easing.Linear);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.