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

Can FSCalendar capable to redraw itself during rotation? #1345

Open
yccheok opened this issue Oct 21, 2021 · 0 comments
Open

Can FSCalendar capable to redraw itself during rotation? #1345

yccheok opened this issue Oct 21, 2021 · 0 comments

Comments

@yccheok
Copy link

yccheok commented Oct 21, 2021

We notice that FSCalendar doesn't redraw itself, after rotation, even we have update its height constraint and perform calendar.layoutIfNeeded()

Our intention is to have a full height calendar, whether it is in portrait or landscape mode.

Screenshot 2021-10-21 at 2 19 47 PM

We have the following code to handle height constraint within view controller.

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    
    let frame = self.view.safeAreaLayoutGuide.layoutFrame
    let height = frame.height
    
    if height != calendarHeightConstraint.constant {
        calendarHeightConstraint.constant = frame.height
        calendar.layoutIfNeeded()
    }
}

Such code is capable to handle FSCalendar view height correctly. This is proven by the yellow background, which fill the entire parent height. (FSCalendar is the only component with yellow background)

However, as you can see in the video, the content of FSCalendar is not being "redraw", when changed from landscape mode to portrait mode.

a

Do you have any suggestion, on how we can fix this limitation?

Thank you.

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

1 participant