zoukankan      html  css  js  c++  java
  • CABasicAnimation 划线动画

    CGFloat animateDuration = 2;
        
        UIBezierPath *bezierPath = [[UIBezierPath alloc] init];
        CGPoint centerFromP = noAnimateView.center;
        [bezierPath moveToPoint:centerFromP];
        CGPoint centerEndP = endView.center;
        [bezierPath addLineToPoint:centerEndP];
        
        CAShapeLayer *layer = [CAShapeLayer layer];
        layer.lineWidth = 5;
        layer.strokeColor = [UIColor blackColor].CGColor;
        layer.fillColor = [UIColor clearColor].CGColor;
        layer.path = bezierPath.CGPath;
        layer.lineCap = kCALineCapRound;
    //    [layer setLineDashPattern:[NSArray arrayWithObjects:[NSNumber numberWithInt:15], [NSNumber numberWithInt:10],nil]];
        
        //create the keyframe animation
        CABasicAnimation *animation = [CABasicAnimation animation];
        animation.keyPath = @"strokeEnd";
        animation.fromValue = [NSNumber numberWithInteger:0];
        animation.toValue = [NSNumber numberWithInteger:1];
        animation.duration = animateDuration;
        animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        [layer addAnimation:animation forKey:nil];
  • 相关阅读:
    事件DOMContentLoaded与load的区别
    JavaScript的执行环境
    JS中函数运行的执行次序
    正则表达式30分钟入门教程
    mysql数据库备份
    杂篇
    memcached
    mysql问题解决
    php学习
    apache 安装
  • 原文地址:https://www.cnblogs.com/tufei7/p/9958654.html
Copyright © 2011-2022 走看看