Skip to content

Instantly share code, notes, and snippets.

@matsukurou
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsukurou/98d96e625b14c54b25ee to your computer and use it in GitHub Desktop.
Save matsukurou/98d96e625b14c54b25ee to your computer and use it in GitHub Desktop.
Xamarin.Formsでビューに拡大縮小アニメーションを設定する
{
// 前面アニメーション用のボックスを生成
var boxViewFront = new BoxView
{
Color = Color.Blue,
};
// 拡大縮小アニメ制御用のボタンを生成
var buttonScale = new Button
{
Text = "Scale",
};
// ボタン押し時の挙動
buttonScale.Clicked += (sender, e) =>
{
if (boxViewFront.Scale == 1)
{
// ボックスのスケールが1だった場合
// 指定秒かけてScaleを0にする
boxViewFront.ScaleTo(0, 500);
}
else
{
// ボックスのスケールが0だった場合
// 指定秒かけてScaleを1にする
boxViewFront.ScaleTo(1, 1000);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment