通过您的动画更改imageView的内容模式!
像使用UIImageView一样使用VICMAImageView
- (void)viewDidLoad {
[super viewDidLoad];
UIImage *image = [UIImage imageNamed:@"1.jpg"];
VICMAImageView *imageView = [[VICMAImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(0, 0, 100, 100);
[self.view addSubview:imageView];
}
在动画块中动画contentMode
[UIView animateWithDuration:0.3
animations:^{
imageView.contentMode = UIViewContentModeScaleAspectFill;
}];
VICMAImageView 在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。