You can make your UIImageView
size as per downloading image but it will give bad look.
So i suggest you to make all your image of same size , so it will be look fine and sweet
you can use this to make all your image of same size.
+ (UIImage *)imageScaledToSizeWithImage:(UIImage *)imagewww andsizeee:(CGSize)size
{
//avoid redundant drawing
if (CGSizeEqualToSize(imagewww.size, size))
{
return imagewww;
}
//create drawing context
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0f);
//draw
[imagewww drawInRect:CGRectMake(0.0f, 0.0f, size.width, size.height)];
//capture resultant image
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//return image
return image;
}
But if you really want to show table with different row size then make change your row size on run time
when you will get image then save your image in dictionary with key value is indexPath of row.
[tableImageDict setObject:image forKey:[NSString stringWithFormat:@"%i,%i",indexPath.row,indexPath.section]];
and then reload your table row.
[table reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationNone];
It will change your row height
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
UIImage *image = (UIImage *)[tableImageDict objectForKey:
[NSString stringWithFormat:@"%i,%i",
indexPath.row,indexPath.section]];
if (image != nil)
{
return image.size.height;
}
else{
return 44.0;
}
}