使用CAShapeLayer 的 转圈圈动画
来源:互联网 发布:淘宝优惠微信群 编辑:程序博客网 时间:2024/06/07 22:30
在View中添加一个加载动画UIView *view = [[UIView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];view.backgroundColor = [UIColor whiteColor];[self.view addSubview:view];CAShapeLayer *shapeLayer = [CAShapeLayer layer];shapeLayer.frame = view.bounds;UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:view.bounds];shapeLayer.path = path.CGPath;shapeLayer.fillColor = [UIColor clearColor].CGColor;shapeLayer.lineWidth = 2;shapeLayer.strokeColor = [UIColor lightGrayColor].CGColor;[view.layer addSublayer:shapeLayer];//任何CABasicAnimation 的@keyPath 为确定的, 此处为strokeEnd//其他keyPath 参考[Ansel_m 的博客](http://blog.csdn.net/majiakun1/article/details/46426727)CABasicAnimation *pathAnima = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];pathAnima.duration = 1.0f;pathAnima.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];pathAnima.fromValue = @0.05f;pathAnima.toValue = @1.0f;pathAnima.repeatCount = 100;pathAnima.fillMode = kCAFillModeForwards;pathAnima.removedOnCompletion = NO;[shapeLayer addAnimation:pathAnima forKey:@"strokeEndAnimation"];
0 0
- 使用CAShapeLayer 的 转圈圈动画
- iOS 转圈圈的动画
- 转圈圈动画animation
- 仿支付宝的付款转圈动画---CAShapeLayer、UIBezierPath、CABasicAnimation
- 类似 刷新的时候 那个转圈圈 动画
- 转圈圈
- 关于AFNetworking菊花转圈圈的问题
- Swift ActivityIndicator 转圈圈的那个玩意
- CAShapeLayer的贝塞尔路径动画
- Android ProgressDialog 转圈圈
- 【简单常用】转圈圈,
- 第八章 转圈圈
- 使用纯CSS3设计加载转圈圈页面
- CAShapeLayer的一些使用
- CAShapeLayer的一些使用
- CAShapeLayer的使用
- 做到一题关于“转圈圈的等边三角形”的题目
- 回旋矩阵 (就是转圈圈打印的,经典面试题)
- php中通过curl smtp发送邮件
- 安装完centos和win7双系统
- Android SwipeLayout实现界面滑动布局
- 优秀字体 —(设计)
- 5.2.1欧几里得算法
- 使用CAShapeLayer 的 转圈圈动画
- 第一篇 Android驱动开发环境搭建之一 -- 虚拟机搭建
- Haskell/Modules
- mfc 创建线程函数AfxBeginThread,线程中访问mfc控件
- Atitit.基于dsl的methodinvoker
- Mac不可或缺的插件-HomeBrew
- Phoenix4.8整合Spark
- MySQL 数据库 基本操作 (新建、增、删、改、查、show)
- python 的日志logging模块学习