Last active
August 29, 2015 14:24
-
-
Save matsukurou/98d96e625b14c54b25ee to your computer and use it in GitHub Desktop.
Xamarin.Formsでビューに拡大縮小アニメーションを設定する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// 前面アニメーション用のボックスを生成 | |
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