2

当我摇动设备时,我正在尝试将图像设置回默认值。问题是,图像正在处理为默认值,然后才会发生rippleEffect。

我试图在动画期间这样做,而不是之前或之后。有任何想法吗?

    -(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
         if(motion == UIEventSubtypeMotionShake){
            CATransition *animation=[CATransition animation];
            [animation setDelegate:self];
            [animation setDuration:1.0];
            [animation setTimingFunction:UIViewAnimationCurveEaseInOut];
            [animation setType:@"rippleEffect"];
            //[animation setFillMode:kCAFillModeRemoved];
            animation.endProgress=0.99;

            [(GPUImageBulgeDistortionFilter *)sepiaFilter setScale:0.0];
            [sourcePicture processImage];

            [animation setRemovedOnCompletion:NO];
            [self.view.layer addAnimation:animation forKey:nil];
        }
    }
4

0 回答 0