Skip to content

Commit 99d7682

Browse files
committed
"_separatorHeight" not available in iOS7.0, rollback.
1 parent f0e37b1 commit 99d7682

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Classes/UITableView+FDTemplateLayoutCell.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ - (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier configuration:(
105105
}
106106
}
107107

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

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

0 commit comments

Comments
 (0)