すべてのセルの UIimageview を 1 つのサイズにしたいのですが、セルの高サイズが変更されると画像が変更されます UIimage の 1 つのサイズが必要です
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if(!cell){
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
}
cell.imageView.image = [UIImage imageNamed:@"England.png"];
cell.imageView.frame = CGRectMake( 2, 0, 25, 25 );
cell.imageView.contentMode = UIViewContentModeScaleAspectFill;
UIFont * myfont = [UIFont fontWithName:@"Helvetica" size:13.0];
cell.textLabel.text = [_data objectAtIndex:indexPath.row];
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.textLabel.numberOfLines = 0;
cell.textLabel.textAlignment = UITextAlignmentCenter;
cell.textLabel.font = myfont;
cell.textLabel.textColor = [UIColor grayColor];
return cell;
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString * description = [_data objectAtIndex:indexPath.row];
CGSize size = [description sizeWithFont:[UIFont boldSystemFontOfSize:14.0f] constrainedToSize:CGSizeMake(190,40) lineBreakMode:UILineBreakModeWordWrap];
return size.height+50;
}