CAShapLayer的使用1】的更多相关文章

使用uibesizerpath Cashaplayer画椭圆: + (void)drawOvalAnimSourceView:(UIView *)sourceView { //view是曲线的背景view UIView *view = [[UIView alloc]initWithFrame:sourceView.bounds]; view.backgroundColor = [UIColor clearColor]; view.transform = CGAffineTransformMake…
IOS-使用CAShapLayer绘制扇形 为了增加应用体验感,我们动态绘制扇形或者饼状图效果. 这里我们使用CAShapeLayer,这样就不必再-(void)draw函数内绘制图形 参考代码 -(void)reDraw { CAShapeLayer *chartLine; if (chartLine!=nil) { [chartLine removeAllAnimations];//这样就能重复绘制饼状图了 } else {  chartLine = [CAShapeLayerlayer];…
1.添加橙色圆环 - (CAShapeLayer *)shapeLayer { if (!_shapeLayer) { _shapeLayer = [CAShapeLayer layer]; CGRect rect = {,,,}; //bezierPathWithOvalInRect圆形路径 bezierPathWithRect 方形路径 UIBezierPath * path = [UIBezierPath bezierPathWithOvalInRect: rect]; _shapeLay…
#import "DrawingView.h" #import <QuartzCore/QuartzCore.h> @interface DrawingView () @property (nonatomic, strong) UIBezierPath *path; @end  @implementation DrawingView + (Class)layerClass // 这是啥意思?????哦哦 调用self.layer可以直接返回CAShapLayer { //…