您的位置:首页 > 移动开发 > IOS开发

iOS图片旋转

2013-07-29 16:59 295 查看
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];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: