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

Layout does not update when device rotates #1388

Open
gsbernstein opened this issue Nov 2, 2022 · 5 comments
Open

Layout does not update when device rotates #1388

gsbernstein opened this issue Nov 2, 2022 · 5 comments

Comments

@gsbernstein
Copy link
Contributor

  • A brief bug description.
    • layout does not update when device rotates
  • Stack trace.
    • n/a
  • Integration method.(manually/cocoapods/carthage)
    • cocoapods
  • Full steps to reproduce.
    • lay out a calendar with autolayout
    • rotate device so that calendar frame changes
    • expected: contents of calendar adjust so that month continues to fit, as stated in feature list https://github.com/WenchaoD/FSCalendar#safe-orientation
    • actual: month may extend offscreen or multiple months may be partially visible
    • workaround:
     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
         calendar.setNeedsLayout()
         calendar.layoutIfNeeded()
     }
    
  • Device modal and iOS version. e.g. iPhone 6s iOS9.1
    • ipad mini 6th gen simulator
  • Xcode version. e.g. Xcode 8.1
    • 14.1
  • FSCalendar version. e.g. FSCalenda 2.5.1
    • 2.8.4
  • Does this happen in the demo project? Which one? Or a link to another demo project.
    • don't know

loading on horizontal, switching to vertical:
Simulator Screen Shot - iPad mini (6th generation) - 2022-11-02 at 11 55 21
loading on vertical, switching to horizontal:
Simulator Screen Shot - iPad mini (6th generation) - 2022-11-02 at 11 52 50

@Azilla030
Copy link

I have the same issue did someone find a fix for this?

@gsbernstein
Copy link
Contributor Author

gsbernstein commented Nov 14, 2022

Workaround mentioned above:

 override func viewDidLayoutSubviews() {
     super.viewDidLayoutSubviews()
     calendar.setNeedsLayout()
     calendar.layoutIfNeeded()
 }

@Azilla030
Copy link

Don't work got another solution I reload the calendar completely new.

@birkoof
Copy link

birkoof commented Dec 25, 2022

same issue, happens only on iOS 16 in my case

@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

4 participants