Skip to content

Commit c1435eb

Browse files
author
wangyutao
committed
fixed problem of iPhoneX accessory width
1 parent cc9ff24 commit c1435eb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Classes/UITableView+FDTemplateLayoutCell.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ - (CGFloat)fd_systemFittingHeightForConfiguratedCell:(UITableViewCell *)cell {
5555
rightSystemViewsWidth += systemAccessoryWidths[cell.accessoryType];
5656
}
5757

58-
if ([UIScreen mainScreen].scale >= 3.0) {
58+
if ([UIScreen mainScreen].scale >= 3 && [UIScreen mainScreen].bounds.size.width >= 414) {
5959
rightSystemViewsWidth += 4;
6060
}
6161

Demo/Demo/FDFeedViewController.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ - (void)configureCell:(FDFeedCell *)cell atIndexPath:(NSIndexPath *)indexPath {
9090
cell.entity = self.feedEntitySections[indexPath.section][indexPath.row];
9191
}
9292

93+
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView {
94+
return @[@"A",@"B",@"C",@"D"];
95+
}
96+
9397
#pragma mark - UITableViewDelegate
9498

9599
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
@@ -188,8 +192,4 @@ - (void)deleteSection {
188192
}
189193
}
190194

191-
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView {
192-
return @[@"A"];
193-
}
194-
195195
@end

0 commit comments

Comments
 (0)