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

Calendar is too short in week scope #268

Closed
Vortec4800 opened this issue Apr 15, 2016 · 7 comments
Closed

Calendar is too short in week scope #268

Vortec4800 opened this issue Apr 15, 2016 · 7 comments

Comments

@Vortec4800
Copy link

I need a week scope calendar at the top of my view. I created the calendar view in my Storyboard, and I have 3 constraints for the two sides and top edges (all 0pt from edge). I also have a height constraint set to 110pt.

Then in my viewDidLoad I set the scope:

override func viewDidLoad() {
    super.viewDidLoad()

    self.weeklyCalendar.setScope(.Week, animated: false)
}

When the view appears, the weekly calendar is only about 55pt tall and the days/dots are very small. If I do something to make the view re-layout (like rotate to landscape and then back to portrait) then it appears correctly.

Any idea why the view wouldn't be acting according to my constraints?

@WenchaoD
Copy link
Owner

Hi @Vortec4800
Can you make an example for this and share a dropbox link or wetransfer?

@Vortec4800
Copy link
Author

Here you go. Note that this project is similar in that if you rotate the simulator the view lays itself out properly. View is set up in the Storyboard, and the constraints are set there as well.

https://dl.dropboxusercontent.com/u/1877511/CalExample.zip

@WenchaoD
Copy link
Owner

Hey @Vortec4800 Please set the height constraint of calendar to 300.

@Vortec4800
Copy link
Author

That doesn't really fix my problem. Can you explain why this is happening? If I set the height to 300 and the view lays itself out again (because of a rotation or other event) then the calendar is too tall.

@WenchaoD
Copy link
Owner

@nuynait
Copy link

nuynait commented Jun 27, 2016

That doesn't really fix my problem. Can you explain why this is happening?

I have this problem as well. After reading @WenchaoD 's replies, things becomes pretty clear. It renders the whole calendar first using its height constraint and then hides all other lines and reveal the week only. The height constraint you give is for the entire weekly calendar.

Thanks.

@iprabhakarpatil
Copy link

how to fix this problem for week scope of calendar

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

5 participants
@Vortec4800 @nuynait @WenchaoD @iprabhakarpatil and others