Hello, I have a list in it, the pictures on the right are displayed, but they have different sizes, and I need to make them the same size. Tell me, please, how to do it. Here is the code:

NSURL *postURL = [NSURL URLWithString:mediaUrl_url]; NSURLRequest *postRequest = [NSURLRequest requestWithURL:postURL]; NSURLResponse *response = nil; NSError *error = nil; NSData *responseData = [NSURLConnection sendSynchronousRequest:postRequest returningResponse:&response error:&error]; [cell.imageView setImage:[UIImage imageWithData:responseData]]; 

    1 answer 1

     NSData *responseData = [NSData dataWithContentsOfURL:[NSURL URLWithString:mediaUrl_url]]; UIImage *temp_image = [[UIImage alloc] initWithData:responseData ]; NSInteger imageWith = 50; CGFloat scale = temp_image.size.width / imageWith; [temp_image release]; UIImage *image = [UIImage imageWithData:responseData scale:scale]; [cell.imageView setImage:image]; 

    This is not really a beautiful solution. But in the table, the cell.imageView setFrame method cell.imageView setFrame not work, and the solution described here cuts off the edges of the image.

    This method works. If anyone knows a better method, write. (most interesting)