iOS图片旋转


    UIImageView *im = [[UIImageView alloc] initWithFrame:CGRectMake(30, 50, 200, 200)];
    im.image = [UIImage imageNamed:@"1.jpg"];
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
    
    animation.delegate = self;
    
    animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI , 0, 0, 1.0)];
    
    animation.duration = 0.2;
    
    animation.cumulative = YES;
    
    animation.repeatCount = INT_MAX;
    
    [im.layer addAnimation:animation forKey:@"animation"];
    

    [self.view addSubview:im];

你可能感兴趣的:(iOS图片旋转)