美文网首页
iPhone锁屏视觉差

iPhone锁屏视觉差

作者: 我把今生当成了来世 | 来源:发表于2017-05-22 17:26 被阅读6次

来这里,了解很多问题,发掘更多。
👇👇👇 传送门->Have-a-problem👇👇👇

示例代码

UIInterpolatingMotionEffect *leftRight = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
leftRight.minimumRelativeValue = @(-28.f);
leftRight.maximumRelativeValue = @(28.f);

UIInterpolatingMotionEffect *upDown = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
upDown.minimumRelativeValue = @(-28.f);
upDown.maximumRelativeValue = @(28.f);

UIMotionEffectGroup *mtGroup = [[UIMotionEffectGroup alloc] init];
mtGroup.motionEffects = @[leftRight, upDown];

[testImageView addMotionEffect:mtGroup];

注意

以上内容为个人整理,如果有问题有出入或者你有更好的解决方法,还请赐教哦,感谢。

相关文章

网友评论

      本文标题:iPhone锁屏视觉差

      本文链接:https://www.haomeiwen.com/subject/jlkixxtx.html