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

标签 ios animation xamarin.ios core-animation

有关于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/

相关文章:

CSS3居中动画

java - 有没有办法为 GridPane 中的元素添加动画效果

ios - iOS 中的破损纹理

ios - objective-c projet : join room 中的 Socket iOS swift 客户端

ios - UITextField 应该只接受正整数并给出休息的警告消息

jquery - 停止当前 CSS 过渡动画

ios - 如何隐藏 UIView 并删除 "empty"空间? -iOS/Monotouch

c# - 在 Binding 项目中实现 MKAnnotation 协议(protocol)

ios - 如何将图像添加到 ios 中 uicollectionView 单元格的左上角?

ios - 带有核心数据的异步图像下载