【发布时间】:2013-11-11 11:09:35
【问题描述】:
好吧,我有一个 UIImageView,我想通过“animationImages”为其图像设置动画,如您在此处看到的:
UIImage *img1 = [[UIImage imageNamed:@"image1.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(20, 150, 20, 150)];
UIImage *img2 = [[UIImage imageNamed:@"image2.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(20, 150, 20, 150)];
self.imgStatus.animationImages = [NSArray arrayWithObjects:img1, img2, nil];
self.imgStatus.animationDuration = 1;
self.imgStatus.contentMode = UIViewContentModeScaleToFill;
[self.imgStatus startAnimating];
这两个图像的宽度小于 UIImageView 的宽度,所以我希望在动画显示它们时调整这些图像的大小。但是动画不会使用“resizableImageWithCapInsets”进行任何调整,只是缩放它们以填充 UIImageView 的框架。
你知道吗?我该怎么做?
谢谢!!
【问题讨论】:
标签: ios objective-c uiimageview resize uiimage