When i select a cell in my tableview, the cell was pushed to the left by the accessoryTypeCheckMark.
my custom cell was programmatically inserted into a tableview
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:
indexPath];
if (selectedCell.accessoryType == UITableViewCellAccessoryNone) {
selectedCell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else {
selectedCell.accessoryType = UITableViewCellAccessoryNone;
}
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Depending on the contents of your cell (more specifically, depending on how far to the right the text extends), the contents will be re drawn to make room for the check mark to appear.
If you don’t want the text to move, you’ll need to draw cell contents yourself using a custom cell subclass.