我使用下面的代码使用视差效果在屏幕上移动图像:
UIInterpolatingMotionEffect *verticalMotionEffect =
[[UIInterpolatingMotionEffect alloc]
initWithKeyPath:@"center.y"
type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
verticalMotionEffect.minimumRelativeValue = @(-20);
verticalMotionEffect.maximumRelativeValue = @(20);
但是当设备面朝上时,值为-20,当设备面朝上时我需要它为0,如何将偏移添加到 UIInterpolatingMotionEffect的值