Content Alignment Issue in UITableView cell
- by OhhMee
Please see the image attached. I don't understand why it's going outside. I've also attached code snippet for tableView.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
// cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
// Configure the cell.
hNode* dCell = [array objectAtIndex:[indexPath row]];
cell.textLabel.text = @"Message";
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@",[dCell contents]];
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.detailTextLabel.numberOfLines = 0;
[[cell imageView] setImage:[UIImage imageNamed:@"user.png"]];
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath {
return 60;
}
Where could be the issue?