-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
FSCalendar has problem with rotating to landscape #182
Comments
Try latest version? |
I'm having this issue and using Pods brought version: FSCalendar (2.1.1), is this the latest one? Also noticed that either scope, at startup, my app doesn't have the necessary data to load the calendar, so after I received my data, I call myFSCalendar.setNeedsLayout but doesn't refresh. Is there a way to refresh the view once it's already loaded? |
@carlos-maldonado-em use calendar.reloadData to refresh |
great!... that did it for the refresh of the UI, thank you. What about the other issue?: "the behavior of the UICollectionViewFlowLayout is not defined because...". It slows down the app because there are 4,369 warnings of this type. |
Hi @carlos-maldonado-em |
Hi WenchaoD, I tried to create a project for you but in that project the failure doesn't show at startup. It only shows when you rotate to landscape. I tried these workarounds (independently of each other): I just dropped it to the dropbox and shared it with you using your email you have in github. thanks! |
I did try your suggestion and it worked but then I realized it has something to do with the size (height) of the FSCalendar object. I updated the project in the dropbox so you can try it. It fails when the size is between in the range [240...267]. I didn't test nor check further on why this could be the case or if there are any other range where it fails, but for sure it fails on that range. Changing the height size of the constraint, so the FSCalendar object updates, then running the project will produce the failure if the size is within that range, otherwise, it'll work with no failure. Curious thing is that in another project I have, it fails with all values. |
Hi Wenchao, Finally I found a workaround, at least the problem hasn't shown any longer. I'm calling the fsCalendar.setScope(scope, animated: true) just before doing the fsCalendar.reloadData(), where scope value is .Week. The only thing is that this solution must be implemented in the viewDidAppear method, or once the view it's already showing to the user and makes the UI to 'jump' a bit from .Month to .Week but that is acceptable, as the problem with UICollectionViewFlowLayout was that the UI was consuming a lot of time while being laid out. thanks for your support! |
FSCalendar works with no problem when the device is in portrait, but as soon as the device rotates to landscape, the app prints out this.
Maybe the problem is caused by the changing of constraints during rotation because I want to use different layout in the landscape as is in the portrait. Whole layout "thing"(AutoLayout,Size Classes) is done in storyboard, nothing in code.
The portrait layout:
The landscape layout:
The text was updated successfully, but these errors were encountered: