Просмотр исходного кода

Uncomment _heightForHeaderInSection override

I forgot but this removes a weird gap at the top of our table views on iOS 12 and below
Tanner Bennett лет назад: 6
Родитель
Сommit
503ce499d1
1 измененных файлов с 24 добавлено и 24 удалено
  1. 24 24
      Classes/Core/Views/FLEXTableView.m

+ 24 - 24
Classes/Core/Views/FLEXTableView.m

@@ -40,30 +40,30 @@ FLEXTableViewCellReuseIdentifier const kFLEXCodeFontCell = @"kFLEXCodeFontCell";
     return [[self alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
     return [[self alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
 #endif
 #endif
 }
 }
-//
-//- (CGFloat)_heightForHeaderInSection:(NSInteger)section {
-//    CGFloat height = [super _heightForHeaderInSection:section];
-//    if (section == 0) {
-//        NSString *title = [self _titleForHeaderInSection:section];
-//        if (self.tableHeaderView) {
-//            if (!@available(iOS 13, *)) {
-//                return height - self.tableHeaderView.frame.size.height + 8;
-//            }
-//            // On iOS 13, returning an empty title for the table view
-//            // messes with the height of the table view later on.
-//            // We return a space to work around this.
-//            else if ([title isEqualToString:@" "]) {
-//                return height - self.tableHeaderView.frame.size.height + 5;
-//            }
-//        } else {
-//            if (@available(iOS 13, *) && [title isEqualToString:@" "]) {
-//                return 5;
-//            }
-//        }
-//    }
-//
-//    return height;
-//}
+
+- (CGFloat)_heightForHeaderInSection:(NSInteger)section {
+    CGFloat height = [super _heightForHeaderInSection:section];
+    if (section == 0) {
+        NSString *title = [self _titleForHeaderInSection:section];
+        if (self.tableHeaderView) {
+            if (!@available(iOS 13, *)) {
+                return height - self.tableHeaderView.frame.size.height + 8;
+            }
+            // On iOS 13, returning an empty title for the table view
+            // messes with the height of the table view later on.
+            // We return a space to work around this.
+            else if ([title isEqualToString:@" "]) {
+                return height - self.tableHeaderView.frame.size.height + 5;
+            }
+        } else {
+            if (@available(iOS 13, *) && [title isEqualToString:@" "]) {
+                return 5;
+            }
+        }
+    }
+
+    return height;
+}
 
 
 #pragma mark - Initialization
 #pragma mark - Initialization