From d587fb260c6118de4707c35a1e312af6a4cfd28c Mon Sep 17 00:00:00 2001 From: 无故事王国 <841720330@qq.com> Date: 星期四, 12 十月 2023 18:25:36 +0800 Subject: [PATCH] fix BUG --- WanPai/Root/Course/VC/CourseOnlineListVC.swift | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/WanPai/Root/Course/VC/CourseOnlineListVC.swift b/WanPai/Root/Course/VC/CourseOnlineListVC.swift index 0cc4557..ec2ece7 100644 --- a/WanPai/Root/Course/VC/CourseOnlineListVC.swift +++ b/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() } -- Gitblit v1.7.1