gpt4 book ai didi

ios - 有关于MonoTouch的新的基于 block 的动画的好的教程吗?

转载 作者:行者123 更新时间:2023-12-01 18:31:29 24 4
gpt4 key购买 nike

有关于MonoTouch的新的基于块的动画的好的教程吗?

我所知道的是,这不是通常的方法:

UIView.BeginAnimations("ImageMove");

//code to make changes to the view (move controls, swap views, etc.)

UIView.CommitAnimations();

...可从iOS 4.0获得的新的基于块的动画方法使用:
UIView.Animate(0.2, () => { /* code to animate */ });

要么:
UIView.Animate(0.2, delegate() { /* code to animate */ });

但是,更详尽的教程将很有用。

提前致谢。

最佳答案

对于monotouch的基于块的动画,该方法是:

Animate(double, double, UIViewAnimationOptions, MonoTouch.Foundation.NSAction, MonoTouch.Foundation.NSAction)
//Animate( animateWithDuration:delay:options:animations:completion )

您可以将其称为 HERE

代码示例如下:
UIView.Animate(0.2, () => { /* code to animate */ });

要么
UIView.Animate(0.2, delegate() { /* code to animate */ });

HEREUIViewAnimationOptions的枚举列表。

我使用以下方法为 cocoa-touch做基于块的动画,将代码粘贴到这里,也许有人需要:
[UIView animateWithDuration:delay:options:animations:completion:]

详细说明是:
[UIView animateWithDuration:<#(NSTimeInterval)#>
delay:<#(NSTimeInterval)#>
options:<#(UIViewAnimationOptions)#>
animations:<#^(void)animations#>
completion:<#^(BOOL finished)completion#>];

您可以像这样制作动画:
[UIView animateWithDuration:0.3f
delay:0.0f
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
// Do your animtion here;
[yourViewController.view setAlpha:0.0];
// ...
}
completion:^{
if (finished) {
// Do sth that after the animation
}
}];

关于ios - 有关于MonoTouch的新的基于 block 的动画的好的教程吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8398323/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com