diff --git a/Classes/UITableView+FDTemplateLayoutCell.m b/Classes/UITableView+FDTemplateLayoutCell.m index f244f6c..9fb2398 100644 --- a/Classes/UITableView+FDTemplateLayoutCell.m +++ b/Classes/UITableView+FDTemplateLayoutCell.m @@ -79,6 +79,10 @@ - (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier configuration:( }; contentViewWidth -= systemAccessoryWidths[templateLayoutCell.accessoryType]; } + // If the tableView has section index titles, the content width is smaller + if([self.dataSource respondsToSelector:@selector(sectionIndexTitlesForTableView:)] && [self.dataSource sectionIndexTitlesForTableView:self].count >0){ + contentViewWidth -= 15; + } CGSize fittingSize = CGSizeZero;