您的位置:首页 > 产品设计 > UI/UE

UIImageView(可扩展至UIView)的抖动

2014-10-09 23:40 127 查看
CABasicAnimation* shake = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; // transform.rotation.z为围绕z轴旋转

    

    //设置抖动幅度

    shake.fromValue = [NSNumber numberWithFloat:-0.1];

    

    shake.toValue = [NSNumber numberWithFloat:+0.1];

    

    shake.duration = 0.1;

    

    shake.autoreverses = YES; //是否重复

    

    shake.repeatCount = 4;

    

    [self.imageView.layer addAnimation:shake forKey:@"imageView"];

    

    self.imageView.alpha = 1.0;

    

    [UIView animateWithDuration:2.0 delay:2.0 options:UIViewAnimationOptionCurveEaseIn animations:nil completion:nil];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Animation