Fork me on GitHub

在UIImageView中旋转图像代码例子

// 创建UIImage对象
UIImage *image = [UIImage imageNamed:@"sample.png"];

// 创建UIImageView
UIImageView *imageView = [ [ UIImageView alloc ] initWithFrame:CGRectMake(0.0, 0.0, image.size.width, image.size.height) ];
imageView.image = image;
[self addSubview:imageView];

// 旋转
CGAffineTransform rotate = CGAffineTransformMakeRotation( 1.0 / 180.0 * 3.14 );
[imageView setTransform:rotate];

posted on 2012-03-27 10:50  pengyingh  阅读(1457)  评论(0)    收藏  举报

导航