使用CAShapeLayer和UIBezierPath绘制色盘
来源:互联网 发布:数据库游标是什么 编辑:程序博客网 时间:2024/06/13 01:15
-(void)drawArcWithStartAngel:(CGFloat)startAngle andEndAngle:(CGFloat)endAngle andColor:(UIColor *)fillColor{
UIBezierPath *path=[UIBezierPath bezierPath];
[path moveToPoint:self.view.center];
[path addLineToPoint:CGPointMake(cos(startAngle)*100+self.view.center.x, sin(startAngle)*100+self.view.center.y)];
[path addArcWithCenter:self.view.center radius:100 startAngle:startAngle endAngle:endAngle clockwise:YES];
[path moveToPoint:CGPointMake(cos(endAngle)*100+self.view.center.x, sin(endAngle)*100+self.view.center.y)];
[path addLineToPoint:self.view.center];
[path closePath];
CAShapeLayer *shapeLayer=[CAShapeLayer layer];
shapeLayer.frame=self.view.frame;
shapeLayer.path=path.CGPath;
shapeLayer.strokeColor=[UIColor whiteColor].CGColor;
shapeLayer.fillColor=fillColor.CGColor;
[self addTap:shapeLayer];
[self.view.layer addSublayer:shapeLayer];
}
- 使用CAShapeLayer和UIBezierPath绘制色盘
- CAShapeLayer和UIBezierPath的使用
- 基于CAShapeLayer和UIBezierPath基本绘制
- [iOS Swift3.0] 定位二维码+绘制定位框+简单使用UIBezierPath和CAShapeLayer
- 使用UIBezierPath和CAShapeLayer画各种图形
- 使用UIBezierPath和CAShapeLayer画各种图形
- 使用UIBezierPath和CAShapeLayer画各种图形
- UIBezierPath+CAShapeLayer 绘制自定义图形
- CAShapeLayer与UIBezierPath绘制图形
- Swift CAShapeLayer,UIBezierPath绘制图形
- 使用 UIBezierPath+CAShapeLayer 实现不在View层绘制自定义图形
- iOS 使用UIBezierPath, CAShapeLayer, CABasicAnimation动态绘制折线
- iOS 通过UIBezierPath和CAShapeLayer绘制圆形进度条
- 使用CAShapeLayer与UIBezierPath
- UIBezierPath和CAShapeLayer简介
- CAShapeLayer和UIBezierPath
- ios CAShapeLayer和UIBezierPath
- 放肆地使用UIBezierPath和CAShapeLayer画各种图形
- 如何下载Skype最新国际纯净版
- 网页常用的各种尺寸
- WPA_SUPPLICANT架构学习之接口介绍
- __autoreleasing 以及OC错误模型 异常 错误 空返回
- widthstep
- 使用CAShapeLayer和UIBezierPath绘制色盘
- 深入理解Java接口
- Apache与Nginx的优缺点比较
- IOS反射,swift反射,基础 MODEL转字典,字典转MODEL,根据下面的自己进行拓展
- Map里面存放Map或List的用法
- #《Hadoop权威指南》——Hadoop简介
- Redis学习记录之Pub/Sub简析(十七)
- 用crontab命令定时PHP文件,并调试
- SuppressWarnings的使用