| | |
| | | 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 |
| | |
| | | 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() |
| | | } |
| | | |