Content Alignment Issue in UITableView cell

Posted by OhhMee on Stack Overflow See other posts from Stack Overflow or by OhhMee
Published on 2011-11-24T01:44:39Z Indexed on 2011/11/24 1:51 UTC
Read the original article Hit count: 136

Please see the image attached. I don't understand why it's going outside. I've also attached code snippet for tableView.

TableView alignment issue

- (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?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about ios