return pagerView
}()
//顶部容器
lazy var headerView: UIView = {
let headerView = UIView(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: ConstantValue.headerH))
headerView.backgroundColor = UIColor.blue
headerView.addSubview(self.banner)
return headerView
}()
lazy var layout: UICollectionViewFlowLayout = {
let layout = UICollectionViewFlowLayout()
layout.minimumLineSpacing = ConstantValue.cellMargin
layout.minimumInteritemSpacing = ConstantValue.cellMargin
layout.scrollDirection = .vertical
layout.sectionInset = UIEdgeInsets(top: ConstantValue.cellMargin, left: ConstantValue.cellMargin, bottom: ConstantValue.cellMargin, right: ConstantValue.cellMargin)
layout.headerReferenceSize = CGSize(width: self.view.bounds.width, height: ConstantValue.sectionHeaderHeight)
return layout
}()
lazy var collectionView: UICollectionView = {
let collectionView = UICollectionView(frame: self.view.bounds, collectionViewLayout: self.layout)
collectionView.register(HeaderViewCell.self, forCellWithReuseIdentifier: CellIdentifier.headerCell.rawValue)
collectionView.register(UINib(nibName: String(describing: SpreadViewCell.self), bundle: nil), forCellWithReuseIdentifier: CellIdentifier.spreadCell.rawValue)
collectionView.delegate = self
collectionView.dataSource = self
return collectionView
}()