Skip to content

Commit

Permalink
"_separatorHeight" not available in iOS7.0, rollback.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyxx committed Jan 9, 2016
1 parent f0e37b1 commit 99d7682
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Classes/UITableView+FDTemplateLayoutCell.m
Expand Up @@ -105,9 +105,10 @@ - (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier configuration:(
}
}

// Add separator's height, using a private property in UITableViewCell.
CGFloat separatorHeight = [[templateLayoutCell valueForKey:@"_separatorHeight"] doubleValue];
fittingSize.height += separatorHeight;
// Add 1px extra space for separator line if needed, simulating default UITableViewCell.
if (self.separatorStyle != UITableViewCellSeparatorStyleNone) {
fittingSize.height += 1.0 / [UIScreen mainScreen].scale;
}

if (templateLayoutCell.fd_enforceFrameLayout) {
[self fd_debugLog:[NSString stringWithFormat:@"calculate using frame layout - %@", @(fittingSize.height)]];
Expand Down

1 comment on commit 99d7682

@everettjf
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

Please sign in to comment.