From 9ce9773e53af57aa1ca8b2bc8d6b90f436d8e605 Mon Sep 17 00:00:00 2001 From: redhat Date: Tue, 12 Jan 2016 20:57:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=9C=89section=20index=20titles?= =?UTF-8?q?=E6=97=B6=E5=81=9A=E4=BA=86=E5=AE=BD=E5=BA=A6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对有section index titles时做了宽度调整 --- Classes/UITableView+FDTemplateLayoutCell.m | 4 ++++ 1 file changed, 4 insertions(+) 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;