新浪微博加號按鈕動畫實現方案

xiao_yuly發表於2016-08-14

1.使用UIView的動畫實現:

+ (void)animateWithDuration:(NSTimeInterval)duration
                      delay:(NSTimeInterval)delay
     usingSpringWithDamping:(CGFloat)dampingRatio
      initialSpringVelocity:(CGFloat)velocity
                    options:(UIViewAnimationOptions)options
                 animations:(void (^)(void))animations
                 completion:(void (^)(BOOL finished))completion

該方法的使用可見:http://blog.csdn.net/jacob_ios/article/details/51678444
2.動畫方案二:

CABasicAnimation *positionAnimation;


        positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"];
        positionAnimation.fromValue = [NSValue valueWithCGPoint:fromPosition];
        positionAnimation.toValue = [NSValue valueWithCGPoint:toPosition];

整個實現的詳細過程程式碼:https://github.com/xinyuly/XYMenuAnimateView

相關文章