Tag: flowlayout

UICollectionViewFlowLayout minimumLineSpacing不适用于整个集合视图 – Swift

我正在为日历创buildUIView子类,其中带有stream布局的UICollectionView用于显示date。 代码是: override func draw(_ rect: CGRect) { super.draw(rect) . . configureCalendarView() . } func configureCalendarView() { cellWd = Double(self.frame.size.width)/7.0 let layout = UICollectionViewFlowLayout.init() layout.minimumLineSpacing = 0.5 layout.minimumInteritemSpacing = 0.0 layout.sectionInset = UIEdgeInsetsMake(1, 0, 0, 0) collectionV = UICollectionView.init(frame: CGRect(x: 0, y:90, width:self.frame.size.width, height:CGFloat(cellWd * 5 + 3.5)), collectionViewLayout: layout) collectionV?.backgroundColor = self.backgroundColor collectionV?.isScrollEnabled = […]