WenchaoD / FSCalendar

A fully customizable iOS calendar library, compatible with Objective-C and Swift
MIT License
10.6k stars 1.94k forks source link

How can I modify the calendar height dynamically? #816

Open mcontin opened 7 years ago

mcontin commented 7 years ago

I'm trying to modify the calendar's height programmatically by modifying its height constraint programmatically but the calendar won't resize its content. The view's frame is updated correctly because I have other views constrained to the bottom and they move, but the content won't adapt. I have implemented boundingRectWillChange but it's not getting called, I've tried calling .layoutIfNeeded() on both the controller's view and the calendar's but nothing changes.

oselvi commented 7 years ago

I have a same problem too. I couldn't figure out a way to do it properly.

hao-li commented 6 years ago

I have a same problem too. I couldn't figure out a way to do it properly.

ronaldofortini commented 6 years ago

Same here.. Database and Delegate are configured

nayanarv commented 6 years ago

Same here. I set height constraint to 0 in viewDidLoad() method. Then changed height to 220 on button tap. Height of view is changing and title is showing, but date cells are not showing.

simulator screen shot - iphone 8 plus - 2018-01-23 at 15 23 13

coolcool1994 commented 6 years ago

Anyone know answer to this problem?? I need to change the height of the Calendar dynamically when the iPad changes its orientation to landscape mode. So far everything I have tried makes it really buggy. I tried it with the demo project too. Changing height constraint of FSCalendar using auto layout breaks things.

GaneshKumarSelvam commented 6 years ago

Do any one got the solution for this?

loyal15 commented 6 years ago

I set the FSCalendar's constraints to left and top are fixed, width and height are fixed on contain view. And set the constraint's height. It works very well. Thanks. 00-0 00-1

kiradea commented 6 years ago

Masonry works too!

发自我的 iPhone

在 2018年7月4日,下午9:42,loyal15 notifications@github.com 写道:

Hello, I solved this issue. I set the FSCalendar's constrains to left and top are fixed, width and height are fixed on contain view. It works very well. Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

alexandre-g commented 6 years ago

https://stackoverflow.com/a/51649753/3046504