patchthecode / JTAppleCalendar

The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable
https://patchthecode.com
MIT License
7.57k stars 809 forks source link

Get equal lines (spacing) in Calendar View #1335

Open elliotcz97 opened 3 years ago

elliotcz97 commented 3 years ago

Version: 8.0.3

I'am using the calendar library since a good while and im loving it!

I recently tried my app on iPhone SE (2nd gen), and noticed a strange behaviour.

The separator lines ( the cell insets, which are getting set by using minimumLineSpacing and minimumInteritemSpacing ) are altering in size. ( sometimes its the right size sometimes its more)

I have set them both to 0.4. And this is what im talking about.

Bildschirmfoto 2021-07-21 um 16 53 40

The calendarView is pinned to trailing and leading, And has a fixed height of 290.

Bildschirmfoto 2021-07-21 um 16 54 08

This is the configuration code: ConfigurationParameters(startDate: startDate, endDate: endDate, numberOfRows: 6, calendar: Calendar.current, generateInDates:InDateCellGeneration.forAllMonths , generateOutDates: OutDateCellGeneration.tillEndOfGrid, firstDayOfWeek: .monday, hasStrictBoundaries: true)

I know this has to do something with UICollectionView described in the issue #1147

My question is how could i solve this problem? Maybe a mathematic calculation for the line size, so that it gives an even number when calculating the cell size. Unfortunatelly i could not come up with a solution for this. I would appretiate some help. Thank you in advance!

elliotcz97 commented 2 years ago

Any chance to get help with this?

patchthecode commented 1 year ago

Apologies for the late response. 2020-2023 has been some interesting years.. I'm assuming you have this resolved.

however, if not, the issue you linked to should have the answer. What is the width of your calendar now? if you give me that number, i can tell you the answer.

or you can just find the nearest multiple of 7 or a number close to it then when divided by 7, doesnt have a re-occuring value.