JTAppleCalendar
JTAppleCalendar copied to clipboard
Non-zero minimum Spacing ignores non-repeating cell size
(Required) Version Number: 8.0.2
Description
Below code worked great until a non-zero minimumLineSpacing
was set.
let width = self.view.frame.width
let cellSize = CGFloat(width / 7).rounded()
calendar.cellSize = cellSize
calendarWidthConstraint.constant = cellSize * 7
// Problematic
calendar.minimumLineSpacing = 4
When performing ranged selection, bug mentioned in various issues (e.g. #1147),arises.
Notes
In addition, setting a single property cellSize
does not insure cell's aspect ratio to be 1:1
. Is this intended and if so, how do I overcome this? Is adjusting the header size an option?
Thanks a bunch and love the package so far 👍
The cells size is determined by by the height for the calendar (if horizontal) or the width of the calendar (if vertical).
As for the lines. What width is your calendar when your app is launched? (you can use the UI debugger to find this)
Seems like the line was caused by a non-circular cornerRadius
. So that problem has been resolved!
Regarding a cell whose aspect ratio is 1:1, how would you recommend going about that in a UI like this?
You already have your calendar height.
Therefore just set the .cellSize
to some value that looks good to you.
Please correct me if I'm wrong but .cellSize
only dictates the width of the cell, right? If that's the case, I'm not able to set the height of the cell without setting the height of the entire calendar.
However, I'm not sure how I would go about calculating the height of the calendar that would insure me that I would get an 1:1 aspect ratio for my cells.
Have you tried setting the cellSize? If your calendar is a vertical calendar, then this is how you set the cell size.
If you want 1:1 then set the cellSize to calendarWidth/7
That's exactly what I'm doing. It works great when calendar.minimumLineSpacing = 0
but breaks when minimumLineSpacing
is a non-zero value. It seems like minimumLineSpacing
adds spacing to the lines by subtracting from the existing line height instead of adding additional spacing in between the lines?
btw, thanks a bunch for the quick responses 👍
let width = self.view.frame.width
let cellSize = CGFloat(width / 7).rounded()
calendar.cellSize = cellSize
calendarWidthConstraint.constant = cellSize * 7
calendar.minimumLineSpacing = 4
@jappleseed69 did you resolve this problem?