I’m creating a grid of thumbnail images, using a UITableView where each cell display 3. At this stage, I’m simply trying to place 3 static images to get placement/size right. But I’m unable to control the position and size of the thumbnail image. Here’s my code for one thumbnail image:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// after getting cell..
UIImage *image = [UIImage imageNamed:@"placeholder.png"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(50.0, 0.0, 85.0, 85.0)];
imageView = [[UIImageView alloc] initWithImage:image];
[cell addSubview:imageView];
return cell;
}
Is my understanding correct that I control the position and size of the image by setting it in the UIImageView?
I appreciate the help.
You need to scale the image in the view: