I'm creating UIView subclass for calendar, wherein UICollectionView with flow layout is used to display dates. The code is :
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 = false
collectionV?.register(DayCell.classForCoder(), forCellWithReuseIdentifier:reuseID)
collectionV?.dataSource = self;
collectionV?.delegate = self;
collectionV?.backgroundColor = calBgColor //lightgray
self.addSubview(collectionV!)
}
Everything is working fine but minimum line spacing is not having any effect between 2nd and 3rd row. Below is the screenshot :
Whats going wrong ? Any help would greatly be appreciated . Thank you !