1

enter image description hereI would like the events to fill the entire horizontal space. These events have no overlap, but strangely they are offset. Any ideas what might be causing this, and how I can make the events take up the entire horizontal space?

I tried moving events around, but the weird offsetting occurs whenever events are back-to-back (not overlapping though). Also, this happened after completing the tutorial with no additional edits.

1 Answers1

0

Try setting eventGap property to a non-zero value, e.g. as mentioned here: https://github.com/richardtop/CalendarKit/pull/290

Richard Topchii
  • 7,075
  • 8
  • 48
  • 115
  • Please mark the question as resolved and let me know if this actually resolved your problem. – Richard Topchii Nov 18 '22 at 07:50
  • Hey, whose property is 'eventGap' exactly? Not sure where exactly I should be setting this property in my DayViewController. – mega-rototo Nov 18 '22 at 19:26
  • 1
    Create a new `DayViewStyle` and set that property on a style, then just call `updateStyle` in your DayViewController. This property is responsible for event overlapping behavior: https://github.com/richardtop/CalendarKit/blob/master/Sources/DayViewController.swift#L78 – Richard Topchii Nov 19 '22 at 09:47
  • For me DayViewStyle is not defined. I was able to figure it out from your hint though: var calendarStyle = CalendarStyle() calendarStyle.timeline.eventGap = 2.0 updateStyle(calendarStyle) Thanks and resolved! – mega-rototo Nov 20 '22 at 09:47
  • Yes, sorry, I was wrong about the style naming. I think it's worth to rename it to `DayViewStyle` as the CalendarKit is mainly about the `DayView` (you have to use other libraries to get Month or Year). – Richard Topchii Nov 20 '22 at 15:11