I have a tableview which displays an image, issue is images are of different quality and size ratio so when they are displayed, they are shown like below
my code on calling this is shown below
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.textLabel.font=[UIFont fontWithName:@"Arial Rounded MT Bold" size:20.0];
cell.detailTextLabel.font=[UIFont fontWithName:@"Arial Rounded MT Bold" size:15.0];
cell.textLabel.textColor = [UIColor whiteColor];
cell.detailTextLabel.textColor = [UIColor whiteColor];
cell.contentView.backgroundColor = [UIColor clearColor];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
cell.backgroundColor = [UIColor clearColor];
cell.imageView.contentMode = UIViewContentModeScaleAspectFill;
Pupils *aPupil = [ArrayOfDisplayIDs objectAtIndex:indexPath.row];
cell.textLabel.text = [NSString stringWithFormat:@"%@ %@", aPupil.firstname,aPupil.secondname];
cell.detailTextLabel.numberOfLines = 3;
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@: %@ Gender: %@ \n%@: %@ \n%@: %@", @"Class",aPupil.Class, aPupil.Gender, @"Date of Birth" ,aPupil.DOB, @"Date of Enrolment" ,aPupil.DateofEntry];
cell.imageView.image = aPupil.picture;
return cell;
}
how can i keep these photos the same size no matter what.
so the picture is same size, same height, same width, or the text all starts in a straight line, just for neatness.
thanks