2016-06-11 2 views
-2

次の番号のアニメーションを実装する方法をお尋ねしますか?お手伝いができることを祈っています。ありがとうございます!次のアニメーションの実装方法は?

enter image description here

それを達成するためにFacebookのポップを使用することができますか?

POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerBounds]; 
springAnimation.springSpeed   = 0; 
springAnimation.springBounciness = 20; 
if (self.testView.frame.size.width == 100) { 
    springAnimation.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 50, 50)]; 
} else { 
    springAnimation.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 100, 100)]; 
} 
[self.testView.layer pop_addAnimation:springAnimation forKey:nil]; 
+0

詳細を教えて、コードを表示できますか? –

+1

スプリングアニメーションを使用して縮尺を変更できます。それは基本的にすべてです。 'PopSpring'の必要はなく、' UIView'にはネイティブのスプリングアニメーションがあります。 – Sulthan

答えて

0

animateKeyFramesをご覧ください。理解を深めるのに役立つサンプルコードを次に示します。

最初にラベルを大きなサイズに設定してみてください。そして、

[UIView animateKeyframesWithDuration:duration delay:delay options:0 animations:^{ 
    [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:frameDuration animations:^{ 
     //decrease view size to a really small size by changing its frame of using CGAffineTransform 
    }]; 
    [UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:frameDuration animations:^{ 
     //increase view size again to make it larger again to an appropriate size 
    }]; 
} completion:nil]; 

あなたが好きなようにアニメーションを作る価値があります。

関連する問題