I have a table-cell which has all default settings. And I put an image on the ImageView on the left, and I put some random text on TextLabel.
and I adjust cell's height using below method.
- (CGFloat)tableView:(UITableView *) tableView heightForRowAtIndexPath: (NSIndexPath *)indexPath
The problem is the left ImageView's frame size is different depend on the cell's height.
See the below image, the 4th cell's height is bigger than others and it's image is slightly right compare to other images.
What causes this and how can I solve this probelm??
-- added
This is my cellForRowAtIndexPath method.
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefaultt reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.numberOfLines = 0;
cell.textLabel.text = [self GetSelectionForRowAtIndexPath:indexPath];
NSString *path = [[NSBundle mainBundle] pathForResource:@"icon_notSelected" ofType:@"png"];
UIImage *theImage = [UIImage imageWithContentsOfFile:path];
cell.imageView.image = theImage;
This shows the imageView does not get bigger even if I put more height on the cell.