IOS_ UIBezierPath + CABasicAnimation + CAShapeLayer
来源:互联网 发布:山西十一选五遗漏数据 编辑:程序博客网 时间:2024/05/16 01:47
UIView *showView = [[UIViewalloc]initWithFrame:CGRectMake(100,100,100,100)];
[self.viewaddSubview:showView];
showView.backgroundColor = [UIColorredColor];
UIBezierPath *path = [UIBezierPathbezierPath];
[path addArcWithCenter:CGPointMake(50,50)radius:45startAngle:0endAngle:kDegreesToRadians(360)clockwise:YES];
UIBezierPath *path1 = [UIBezierPathbezierPath];
[path1 moveToPoint:CGPointMake(10,50)];
[path1 addLineToPoint:CGPointMake(50,80)];
[path1 addLineToPoint:CGPointMake(80,10)];
[path appendPath:path1];
CAShapeLayer *checkLayer = [CAShapeLayerlayer];
checkLayer.path = path.CGPath;
checkLayer.frame = showView.bounds;
checkLayer.fillColor = [UIColorclearColor].CGColor; //填充颜色
checkLayer.strokeColor = [UIColorwhiteColor].CGColor; //线条颜色
checkLayer.lineWidth =3.0;
checkLayer.lineCap =kCALineCapRound;
checkLayer.lineJoin =kCALineJoinRound;
checkLayer.speed =1; //速度
[showView.layeraddSublayer:checkLayer];
CABasicAnimation *checkAnimation = [CABasicAnimationanimationWithKeyPath:@"strokeEnd"];
checkAnimation.duration =1.3f;
checkAnimation.fromValue = [NSNumbernumberWithFloat:0];
checkAnimation.toValue = [NSNumbernumberWithFloat:1.0];
// checkAnimation.autoreverses = YES; //动画按原路返回
// checkAnimation.delegate = self;
// checkAnimation.repeatCount = MAXFLOAT; //设置动画次数
// checkAnimation.repeatDuration = 8; //设置动画持续时间
checkAnimation.fillMode =kCAFillModeForwards;
// checkAnimation.beginTime = CACurrentMediaTime()+2; //延迟2秒 CACurrentMediaTime() 为当前动画时间
[checkLayer addAnimation:checkAnimationforKey:nil];
- IOS_ UIBezierPath + CABasicAnimation + CAShapeLayer
- iOS动画详解 (CABasicAnimation,UIBezierPath,CAShapeLayer)
- 仿支付宝的付款转圈动画---CAShapeLayer、UIBezierPath、CABasicAnimation
- iOS 使用UIBezierPath, CAShapeLayer, CABasicAnimation动态绘制折线
- CAShapeLayer UIBezierPath
- CAShapeLayer与UIBezierPath
- UIBezierPath和CAShapeLayer简介
- 使用CAShapeLayer与UIBezierPath
- CAShapeLayer与UIBezierPath
- CAShapeLayer与UIBezierPath
- CAShapeLayer和UIBezierPath
- ios CAShapeLayer和UIBezierPath
- CAShapeLayer + UIBezierPath = sectionView
- CAShapeLayer与UIBezierPath
- 一:UIBezierPath和CAShapeLayer简介
- UIBezierPath 和 CAShapeLayer 画画图
- UIBezierPath+CAShapeLayer 绘制自定义图形
- CAShapeLayer与UIBezierPath绘制图形
- GitHub详细教程
- 三应用Wireshark观察基本网络协议
- Android控件RecyclerView和ListView的异同
- 记录
- tomcat设置默认项目
- IOS_ UIBezierPath + CABasicAnimation + CAShapeLayer
- Qt之图形(组合)
- maven & protobuf -1
- NYtimes- Shooting at Orlando Nightclub Kills 50, Police Say
- safari、IE、360浏览器兼容模式 js 中字符串转日期格式
- maveweb配置
- 【笔记】世界坐标系和相机坐标系的转换
- iOS开发系列--音频播放、录音、视频播放、拍照、视频录制
- 商城代码开源