I have a custom tableview and under each cell i have image-view. I am receiving images of different sizes from the service and i want to adjust my frame according to that.
Whenever there is a picture smaller than the frame size i want to adjust the height according to its height.
So i am comparing the current frame size and image size and trying to update the imageview frame,but its not working.
cell.image.contentMode = UIViewContentModeScaleAspectFit;
if(cell.image.image.size.height<cell.image.frame.size.height)
{
cell.image.frame = CGRectMake(cell.image.frame.origin.x, cell.image.frame.origin.y,cell.image.frame.size.width, cell.image.image.size.height);
}
what needs to be done to overcome the problem??