我正在玩Facebook纸质应用程序,并意识到全尺寸图像的视差效果非常酷.所以我去自己的应用程序尝试.但视差并没有像facebook纸质应用那样流畅.
这是我用过的代码
UIInterpolatingMotionEffect *parallaxHorizontal = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.x"
type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
parallaxHorizontal.minimumRelativeValue = @-100.0;
parallaxHorizontal.maximumRelativeValue = @100.0;
[_myImageView addMotionEffect:interpolationHorizontal];
Run Code Online (Sandbox Code Playgroud)
无论如何,让视差移动稍微更快,更顺畅,或实现像facebook纸质应用程序.
谢谢!