图片由小到大缓慢显示的效果

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
[imageView setImage:[UIImage imageNamed:@"star.png"]];
self.myImageView = imageView;
[self.view addSubview:imageView];
[imageView release];
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:2.5];
CGImageRef img = [self.myImageView.image CGImage];
[myImageView setFrame:CGRectMake(0, 0, CGImageGetWidth(img), CGImageGetHeight(img))];    
[UIView commitAnimations];

 

你可能感兴趣的:(ios,iPhone)