gpt4 book ai didi

objective-c - 核心动画 : raster not animating

转载 作者:行者123 更新时间:2023-11-28 22:58:58 24 4
gpt4 key购买 nike

我正在尝试通过将栅格应用于 CALayer 来执行快速而肮脏的“模糊”。 CA 文档说 shouldRasterize 是可动画的,但是我没有得到任何动画。代码如下:

 CABasicAnimation* blurAnimation;
blurAnimation = [CABasicAnimation animationWithKeyPath:@"rasterize"];
blurAnimation.removedOnCompletion = NO;
blurAnimation.autoreverses = YES;
blurAnimation.duration = 3.0f;
blurAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
blurAnimation.repeatCount = 20; // HUGE_VALF;
blurAnimation.fromValue = [NSNumber numberWithFloat:0.3f];
blurAnimation.toValue = [NSNumber numberWithFloat:1.0f];
[theCheck setShouldRasterize:YES];

// Add animation to the layer and make it so
[theCheck addAnimation:blurAnimation forKey:nil];

最佳答案

您是否尝试将“rasterize”更改为“rasterizationScale”?

关于objective-c - 核心动画 : raster not animating,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10305158/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com