IOS利用UIBezierPath画动画圆
2015-01-28 16:42
183 查看
- (void)drawRoundView:(CGPoint)centerPoint withStartAngle:(CGFloat)startAngle withEndAngle:(CGFloat)endAngle withRadius:(CGFloat)radius { UIBezierPath *path = [UIBezierPath bezierPath]; [path addArcWithCenter:centerPoint radius:radius startAngle:startAngle endAngle:endAngle clockwise:YES]; arcLayer = [CAShapeLayer layer]; arcLayer.path = path.CGPath; //arcLayer.strokeColor可设置画笔颜色 arcLayer.lineWidth = 10; arcLayer.frame = self.bounds; arcLayer.fillColor = [UIColor whiteColor].CGColor; [self.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"]; }
相关文章推荐
- iOS-利用UIBezierPath和CAAnimation制作路径动画
- IOS利用UIBezierPath画动画圆
- iOS利用UIBezierPath + CAAnimation实现路径动画效果
- iOS-利用UIBezierPath和CAAnimation制作心跳动画
- iOS中利用UIBezierPath + CAAnimation实现心跳动画效果
- [IOS 开发] 利用Runtime自定义控制器POP手势动画
- iOS利用Runtime自定义控制器POP手势动画
- iOS利用Runtime自定义控制器POP手势动画
- iOS利用Runtime自定义控制器POP手势动画
- 【iOS开发-50】利用创建新的类实现代码封装,从而不知不觉实践一个简单的MVC实验,附带个动画
- iOS动效-利用CATransform3D实现翻页动画效果
- iOS绘图系列六:利用CAShapeLayer和UIBezierPath或者CGPath绘制想要的图像
- 利用UIBezierPath实现的橡皮筋动画效果(OC版)
- 轻松学习之二——iOS利用Runtime自定义控制器POP手势动画
- 如何在ios中的UI界面利用相框制作gif动画
- [IOS 开发] 利用UIWebView 加载GIF动画
- 利用iOS动画来模拟音量振动条的实现
- iOS利用Runtime自定义控制器POP手势动画
- iOS利用Runtime自定义控制器POP手势动画
- iOS利用Runtime自定义控制器POP手势动画(经典)