FSCalendar
FSCalendar copied to clipboard
Date cells and month/year get messed up when changing orientation from portrait to landscape and vice versa
Date cells and month/year get messed up when changing orientation from portrait to landscape and vice versa. The cells misalign and month/year goes to random like year 2035 or 2006. After that when I change orientation again everything goes back to normal, very strange bug! Integration method: cocoapods Steps to reproduce: Change orinetation from landscape to portrait and vice versa ipad mini 2 and iphone 6 both ios 12.1 Xcode version. 10.1 FSCalendar version: multiple versions have this issue, I tried 2.6, 2.7.9 and 2.8.0
Screenshots:
I start with for example 11/11/2018 date selected (current day by default) and I change orientation and get this:
I managed to make a temporary workaround which seems to work only for version 2.7.9:
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: {_ in self.calendar.reloadData() }, completion: nil) }
It looks almost the same as this unsolved issue: https://github.com/WenchaoD/FSCalendar/issues/434
Can you check if it is working with my change? https://github.com/WenchaoD/FSCalendar/pull/766 And if it is working you can support it to be merged.
Same problem here.
@mxp7064 i faced this issue you just set aspect to fit content mode for CalenderView.
this still seems to be happening even with change 766, @VDPurohit can you post your code you used to fix it ? not sure what view to set for content mode. Thanks! @asam139 it seems to only be an issue with iphone x (xs) screens, i tried on an emulator on an iphone 6s and it worked fine, maybe it has something to do with safe areas?
Just started using this calendar today, and had the same thing happen. Year jumped to 2035 in May. Rotated the iPad and it jumped back.
@ajprala set content mode of calendar view:-select calendar view->Inside Attribute inspector -> content mode set to scale to fill.
Anyone news on this? I'm getting the same thing with the 2035 date as well. I've tried both content mode suggestions.
having the same issue anybody find some solution for that?
pull request If a contributor does not merge the pull request then just checkout this fork and update your podfile to use local path:
pod 'FSCalendar', :path => '../FSCalendar'