2011-12-06 14 views
1

MonoTouchを使った新しいブロックベースのアニメーションについての良いチュートリアルはありますか?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のブロックベースのアニメーションについては

答えて

4

、方法は次のとおりです。

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 
        } 
       }]; 
+0

しかし、私が知る限り、これはiOS5だけであることに留意してください。 – Krumelur

+3

@Krumelurではなく、iOS 4.0以降で使用できます。 :) [doc](http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html)を参照してください。 – Kjuly

+0

ああ、大丈夫です。ありがとう。 – Krumelur

関連する問題