Hide legend view when date indicators are empty

This commit is contained in:
vasavk 2024-05-16 16:55:00 +05:30
parent 455d5b1949
commit ff0117dc1d

View File

@ -67,7 +67,7 @@ open class CalendarBase: Control, Changeable {
//--------------------------------------------------
// MARK: - Private Properties
//--------------------------------------------------
internal var containerSize: CGSize { CGSize(width: 328, height: 376) }
internal var containerSize: CGSize { CGSize(width: 328, height: 336) }
internal var calendar = Calendar.current
private let cellItemSize = CGSize(width: 40, height: 40)
@ -358,7 +358,7 @@ extension CalendarBase: UICollectionViewDelegate, UICollectionViewDataSource, UI
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
return CGSize(width: collectionView.frame.size.width, height: footerHeight)
return CGSize(width: collectionView.frame.size.width, height: indicators.count > 0 ? footerHeight : 0)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {