#import "ITViewController.h"
@interface ITViewController ()
@property (strong,nonatomic)UIImageView *img;
@end
@implementation ITViewController
@synthesize img;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.view.backgroundColor=[UIColor grayColor];
img=[[UIImageView alloc]initWithFrame:CGRectMake(self.view.frame.size.width/2-32, self.view.frame.size.height/2-32, 64.0f, 64.0f)];
[img setImage:[UIImage imageNamed:@"页面跳转加载.png"]];
[self.view addSubview:img];
[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(bianxing) userInfo:nil repeats:YES];
}
-(void)bianxing
{
static float i=1.0f;
if(i==13.0f)
{
i=1;
}
[img setTransform:CGAffineTransformMakeRotation(M_PI*2*(30*i)/360.0f) ];
i++;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
【初学】iOS学习笔记-图片旋转
最新推荐文章于 2016-05-29 12:34:00 发布