动画画圆的效果特效ios源码

一款不错的支持动画画圆的效果特效源码,该效果实现了动画画圆,还可以扩展成画其他平面图形功能等,大家可以下载看看吧。
动画画圆的效果特效ios源码
//定义所需要画的图形 
-(void)intiUIOfView 

    UIBezierPath *path=[UIBezierPath bezierPath]; 
    CGRect rect=[UIScreen mainScreen].applicationFrame; 
    [path addArcWithCenter:CGPointMake(rect.size.width/2,rect.size.height/2-20) radius:100 startAngle:0 endAngle:2*M_PI clockwise:NO]; 
    arcLayer=[CAShapeLayer layer]; 
    arcLayer.path=path.CGPath;//46,169,230 
    arcLayer.fillColor=[UIColor colorWithRed:46.0/255.0 green:169.0/255.0 blue:230.0/255.0 alpha:1].CGColor; 
    arcLayer.strokeColor=[UIColor colorWithWhite:1 alpha:0.7].CGColor; 
    arcLayer.lineWidth=3; 
    arcLayer.frame=self.view.frame; 
    [self.view.layer addSublayer:arcLayer]; 
    [self drawLineAnimation:arcLayer]; 


//定义动画过程 
-(void)drawLineAnimation:(CALayer*)layer 

    CABasicAnimation *bas=[CABasicAnimation animationWithKeyPath:@"strokeEnd"]; 
    bas.duration=1; 
    bas.delegate=self; 
    bas.fromValue=[NSNumber numberWithInteger:0]; 
    bas.toValue=[NSNumber numberWithInteger:1]; 

    [layer addAnimation:bas forKey:@"key"]; 


}


源码下载:

http://code.662p.com/view/2993.html

 

你可能感兴趣的:(ios)