IOS水平方向和垂直方向的视觉差

 1  UILabel *lb=[[UILabel alloc] init];
 2 UIInterpolatingMotionEffect *motinEffect;
 3 motinEffect=[[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
 4 motinEffect.minimumRelativeValue=@(-25);
 5 motinEffect.maximumRelativeValue=@(25);
 6 [lb addMotionEffect:motinEffect];
 7 motinEffect=[[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
 8 motinEffect.maximumRelativeValue=@(25);
 9 motinEffect.minimumRelativeValue=@(-25);
10 [lb addMotionEffect:motinEffect];
11 
12 [self.view addSubview:lb];

 

posted on 2016-09-01 09:38  巴顿的博客  阅读(377)  评论(0编辑  收藏  举报

导航