2012-04-30 7 views
0

私のチェーンアニメーションの1つに奇妙な問題があります。私は自分の画面(26個)のブロックごとにブロックオブジェクトを持っており、ユーザーがそれらを押すとフリップを実行します。それは素晴らしいですが、私はこれらを行う前にスケールのアニメーションを追加して、画面上で約50%大きくします。だから、私の順序は次のとおりです。ios transform.rotation.yはウィンドウを分割します

は 遅延(ユーザーが大きな画像を見てみましょう) スピンアウトが90%(ビューからブロックを削除します)拡大 - transform.rotation.y 変化画像&スピンで シュリ​​ンクを使用します。

私は(setZpositionを使用して)上の右副層を配置できるように、それがブロックにカウンタを渡すことができるように、これらのブロックの代表であると設定ウィンドウの表示制御部を有します。

2つのブロックが画面上に上下に配置されている場合を除き、拡大がオーバーラップしてスピンアウトアニメーションが開始されると、すぐにブロックポップの右端がその下のブロックの後ろにあります。私はtransform.rotation.xにアニメーションを変更しようとしたが、ブロックが左右にあるときに同じ動作をする。

私はちょうど何か正しいことをしていない場合のiOSのバグかどうかはわかりません。どんな提案も大歓迎です。ここにスピンアウトの方法があります:

- (void)spinOut:(id)sender 
{ 
    NSTimeInterval animationTime=0.85; 

    [UIView animateWithDuration:animationTime 
         delay:0 
        options: UIViewAnimationOptionCurveLinear 
       animations:^{ 
        // setup the animation to spin the current view out 
        [CATransaction begin]; 
        [CATransaction setDisableActions:YES]; 
        CABasicAnimation *spinOut = [CABasicAnimation animationWithKeyPath:@"transform.rotation.y"]; 
        [spinOut setDelegate:self]; 
        [spinOut setDuration:animationTime]; 
        CAMediaTimingFunction *tf = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 
        [spinOut setTimingFunction:tf]; 
        [spinOut setFromValue:[NSNumber numberWithFloat:M_PI * 0.0]]; 
        [spinOut setToValue:[NSNumber numberWithFloat:M_PI * 0.5]]; 
        [spinOut setRemovedOnCompletion:NO]; 
        [spinOut setFillMode:kCAFillModeForwards]; 

        // setup variables used to roll in the next view on animation completion. 
        [pageView.layer addAnimation:spinOut forKey:kMyVeryOwnABCsSpinOutKey]; 

        [CATransaction commit]; 
       } 
       completion:^(BOOL finished){ 
        [self setFlipOutAnimationTimer:[NSTimer scheduledTimerWithTimeInterval:animationTime target:self selector:@selector(spinIn:) userInfo:nil repeats:NO]]; 
       }]; 

} 
+0

よく、これは難しい問題です。イメージを縮小した後でスピンを行うつもりです。私は十分に良いと思う。 – jpporterVA

答えて

0

OK - これは古い問題ですが、私はこの問題を理解しました。私はY軸の周りにこれらの画像を反転していたので、私はアニメーション画像のZpositionを変更することができました。私startAnimation方法では、私が追加:

float pageLevelLayerPosition; 
    // logic to set the zposition variable 100 more than anything nearby 

    _originalImageViewZPosition = bigImageView.layer.zPosition; 
    [bigImageView.layer setZPosition:pageLevelLayerPosition]; 

、その後ときanimationDidStopでは、私はアニメーションを削除して0に戻ってそれをリセットするためのコードの該当する行を追加しました。変数を管理するためのコードをいくつか用意していたので、その数は近くのものよりも大きかったと確信していました。

私が今までに3-Dアニメーションに入る場合、私は、私ははるかに密接にこれを制御する必要があるでしょう、と思いますが、それは私の問題を引き起こしていたものです。

関連する問題