Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date cells and month/year get messed up when changing orientation from portrait to landscape and vice versa #1022

Open
mxp7064 opened this issue Nov 11, 2018 · 9 comments

Comments

@mxp7064
Copy link

mxp7064 commented Nov 11, 2018

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:
45879644_726276941052574_8620385416207400960_n

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:
#434

@asam139
Copy link

asam139 commented Nov 19, 2018

Can you check if it is working with my change? #766
And if it is working you can support it to be merged.

@frasza
Copy link

frasza commented Dec 18, 2018

Same problem here.

@VDPurohit
Copy link

@mxp7064 i faced this issue you just set aspect to fit content mode for CalenderView.

@ajprala
Copy link

ajprala commented Dec 26, 2018

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?

@hooji
Copy link

hooji commented Jan 9, 2019

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.

@VDPurohit
Copy link

@ajprala set content mode of calendar view:-select calendar view->Inside Attribute inspector -> content mode set to scale to fill.

@keithmichelson
Copy link

Anyone news on this? I'm getting the same thing with the 2035 date as well. I've tried both content mode suggestions.

@asar1
Copy link

asar1 commented Sep 4, 2019

having the same issue
anybody find some solution for that?

@jonpittock
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants