ios - CALayer 不透明动画没有按我的意愿工作
问题描述
看看下面的代码。这是一个简单的动画,但是当我设置 时beginTime = AVCoreAnimationBeginTimeAtZero
,动画没有正常工作,否则没关系。
CABasicAnimation *animation = [CABasicAnimation
animationWithKeyPath:@"opacity"];
animation.duration = 2.f;
// animation.beginTime = AVCoreAnimationBeginTimeAtZero;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
animation.fromValue = [NSNumber numberWithFloat:1.0];
animation.toValue = [NSNumber numberWithFloat:0];
animation.delegate = self;
[layer addAnimation:animation forKey:@"basicAnimation"];
解决方案
推荐阅读
- dart - 如何读取此值并将其分配给 sqlite Flutter 中的变量?
- scala - 如何在intelliJ中调试scala spark代码
- hsqldb - HSQLDB 使用嵌套查询时触发 OutOfMemoryError 并且 DB 处于只读模式
- spring-boot - Spring Boot 中的 HTTP 响应过滤器
- python - 如何使用pyspark将没有标题的行从数据框中获取到列表中
- visual-studio - 停止调试会话时终止服务结构实例
- c# - MVVM 使用绑定改变文化
- r - 在 R 的控制台输出中更有效和更快地打印值的策略
- sql - sql如何在timein超时之间获取员工的先进性
- amazon-web-services - DBR 报告中的 AWS 自定义区域缩写