- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
除了在图像编辑软件中手动调整 PNG 之外,有没有办法以编程方式简化此动画?即:显示缓出效果。除非我使用错误的关键字来搜索答案,否则我已经看过但没有在网上看到答案。
NSMutableArray * images = [@[] mutableCopy];
for (int i = currentFrame; i <= maxFrame; i++) {
NSString * imageString = [NSString stringWithFormat:@"icon_introchart_%ld",i];
UIImage * newImage = [UIImage imageNamed:imageString];
[images addObject:newImage];
}
_introChart.animationImages = images;
_introChart.animationDuration = 2.0f;
_introChart.animationRepeatCount = 1;
已编辑 -> 但我仍然遗漏了一些东西:
CAKeyframeAnimation * animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
[animation setCalculationMode:kCAAnimationLinear];
animation.duration = 2.0;
animation.values = images;
animation.repeatCount = 1;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
[animation setRemovedOnCompletion:YES];
[_introChart.layer addAnimation:animation forKey:@"contents"];
// _introChart.animationImages = images;
// _introChart.animationDuration = 2.0f;
//_introChart.animationRepeatCount = 1;
编辑:我需要为“内容”提供 CGImageRefs 而不是 UIImages...它现在可以工作了。
UIImage * newImage = [UIImage imageNamed:imageString];
CGImageRef cgImage = [newImage CGImage];
[images addObject:(__bridge id)(cgImage)];
最佳答案
简单的 UIImage 动画就是这么简单。你当然可以做你想做的事,但你必须使用真实的动画才能获得你所要求的那种时间控制。最简单的方法可能是使用 CAKeyframeAnimation,它可以让您控制动画“帧”的时间。
关于ios - 以编程方式 easeOut UIImageView animationImages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27805203/
除了在图像编辑软件中手动调整 PNG 之外,有没有办法以编程方式简化此动画?即:显示缓出效果。除非我使用错误的关键字来搜索答案,否则我已经看过但没有在网上看到答案。 NSMutableArray *
我有以下自定义 SKAction 工作,但作为 EaseIn 而不是 EaseOut。我想让它缓和!我使用在网络上找到的各种缓动方程来更正它,但不幸的是失败了。 let duration =
嗨,我正在尝试创建侧边菜单,但收到警告,我已经搜索了很多选项,但对我没有任何帮助,请帮助我 我用过的代码: -(void) animatedLayerToPoint:(CGFloat)x {
我已经安装了新的 iOS 6.1 和 Xcode 4.6,现在我的代码中有一些枚举警告,我无法解决这个问题: [UIView animateWithDuration:0.4
我是一名优秀的程序员,十分优秀!