I'm using an expandable TableView, (HVTableView), and in it I'm setting some images, which are downloaded from URLs. Problem is the images are not setting as AspectFill even though I've set everything in Storyboard as well as code.
code:
UIImageView *imageView = (UIImageView *)[cell viewWithTag:0];
if (object.imageFile) {
[object.imageFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
UIImage *image = [UIImage imageWithData:data];
[imageView setClipsToBounds:YES];
[imageView setContentMode:UIViewContentModeScaleAspectFill];
[imageView setImage:image];
}
else [imageView setImage:[UIImage imageNamed:@"placeholder"]]; //initiL state
}];
}
else {
[imageView setImage:[UIImage imageNamed:@"placeholder"]];
}
Result:
If I use local images, then they show perfectly, as square and aspectFill or whichever contentMode is set