Mar*_*las 4 c# xamarin xamarin.forms
我想知道如何同时运行两个动画
public async void OnClicked2Async(object sender, EventArgs e)
{
btn_login.SetValue(IsVisibleProperty, true);
await btn_login.TranslateTo(0, 175, 1000);
await btn_novaconta.TranslateTo(0, -60, 1000);
}
Run Code Online (Sandbox Code Playgroud)
这是我的代码
您可以通过将Animation实例添加到父/主Animation实例然后提交它们来“分组”动画:
var button1Anim = new Animation(_ => button1.TranslateTo(0, 175, 1000));
var button2Anim = new Animation(_ => button2.TranslateTo(0, 175, 1000));
var masterAnimation = new Animation
{
{ 0, 1, button1Anim },
{ 0, 1, button2Anim }
};
masterAnimation.Commit(this, "MyAnim");
Run Code Online (Sandbox Code Playgroud)
回复:自定义动画