richardtop / CalendarKit

📅 Calendar for Apple platforms in Swift
https://www.youtube.com/watch?v=cJ63-_z1qg8
MIT License
2.48k stars 333 forks source link

"isHeaderViewVisible" only hide the subview without resizing the timelinePageViewer #338

Open Jhegs opened 2 years ago

Jhegs commented 2 years ago

New Issue Checklist

Issue Description

After to set the property to false, this sentence only hide the dayHeaderView view leaving a white space (The green background is just for reference)

myView.isHeaderViewVisible = false
Screen Shot 2022-06-07 at 17 30 45

Result I am trying to achieve

The possible fix that needs a change in the library.

I did a small change on the file DayView (inside CalendarKit) project removing the else


// Before
override public func layoutSubviews() {
    super.layoutSubviews()
    if #available(iOS 11, *) {} else {
        ...
    }
  }

// After
override public func layoutSubviews() {
    super.layoutSubviews()
    if #available(iOS 11, *) { // Removing the else case
        ...
    }
  }

and the frame is recalculated.

Screen Shot 2022-06-07 at 17 36 49

Final Note

To be sure that I'm not doing something wrong in my project I did the same change trying with the CalendarKitDemo project inside this repository and the bug is present.

Screen Shot 2022-06-07 at 18 14 58

richardtop commented 2 years ago

It's a confirmed bug