1
我想使用CGAffineTransformScale製作UIImageView的動畫,並伴隨着動畫,uiimageview也應該改變它的原點。讓我寫下面的方法,UIImageView動畫問題?
- (無效)imageDidMoving {
imageV = [[UIImageView alloc] init];
imageV.frame = CGRectMake(0, 0, 768, 1024);
imageV.contentMode = UIViewContentModeScaleToFill;
[self.view addSubview:imageV];
imageV.image = [UIImage imageNamed:@"image.png"];
imageV.autoresizingMask = UIViewAutoresizingFlexibleWidth || UIViewAutoresizingFlexibleHeight;
imageV.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.1, 0.1);
[UIView beginAnimations:@"image animation" context:nil];
[UIView setAnimationDuration: 0.75];
imageV.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.0, 1.0);
[UIView commitAnimations];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.3];
imageV.transform = CGAffineTransformScale(CGAffineTransformIdentity,1.5, 1.5);
[UIView commitAnimations];
}
,但它並沒有奏效。 我也使用CGAffineTransformScale代替,
CGRect frame2 = CGRectMake(70,70, 300, 600);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
imageView.frame = frame2;
[UIView commitAnimations];
,但它也不能正常工作?
如何在不使用NSTimer的情況下縮放和更改UIImageView的原點?
硬編碼永遠不是解決方案 – 2013-01-16 15:55:04