码迷,mamicode.com
首页 > 移动开发 > 详细

ios7自带的晃动效果

时间:2014-08-01 19:47:12      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:ios

ios7自带的晃动效果

by 伍雪颖

- (void)registerEffectForView:(UIView *)aView depth:(CGFloat)depth;
{
     UIInterpolatingMotionEffect *effectX;
     UIInterpolatingMotionEffect *effectY;
    effectX = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x"
                                                              type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
    effectY = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y"
                                                              type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
    
    
     effectX.maximumRelativeValue = @(depth);
     effectX.minimumRelativeValue = @(-depth);
     effectY.maximumRelativeValue = @(depth);
     effectY.minimumRelativeValue = @(-depth);
    
     [aView addMotionEffect:effectX];
     [aView addMotionEffect:effectY];
}


ios7自带的晃动效果,布布扣,bubuko.com

ios7自带的晃动效果

标签:ios

原文地址:http://blog.csdn.net/rainlesvio/article/details/38340073

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!