无故事王国
2023-10-12 d587fb260c6118de4707c35a1e312af6a4cfd28c
WanPai/Root/Course/VC/CourseOnlineListVC.swift
@@ -71,9 +71,11 @@
        flowlayout.minimumLineSpacing = 22
//        flowlayout.sectionHeadersPinToVisibleBounds = true
        flowlayout.headerReferenceSize = CGSize(width: JQ_ScreenW, height: 52)
      flowlayout.footerReferenceSize = CGSize(width: JQ_ScreenW, height: 1)
        collectionView = BaseCollectionView(frame: .zero, collectionViewLayout: flowlayout)
        collectionView.register(UINib(nibName: "CourseOnlineCCell", bundle: nil), forCellWithReuseIdentifier: "_CourseOnlineCCell")
        collectionView.register(UINib(nibName: "CourseOnlineHeadView", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "_CourseOnlineHeadView")
      collectionView.register(UICollectionReusableView.self, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "_footer")
        collectionView.delegate = self
        collectionView.dataSource = self
      collectionView.backgroundColor = .white
@@ -131,6 +133,14 @@
            headerView.label_name.text = viewModel.dataSource.value[indexPath.section].name
            return headerView
        }
      if kind == UICollectionView.elementKindSectionFooter{
         var footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "_footer", for: indexPath)
         footerView.backgroundColor = UIColor(hexStr: "#979797").withAlphaComponent(0.29)
         return footerView
      }
        return UICollectionReusableView()
    }