如何缩放FSCalendar的高度?

时间:2017-09-06 07:23:14

标签: ios swift swift3 scaling fscalendar

我在我的项目中使用FSCalendar,我想知道如何让我的日历比例达到动画的新高度?我有一个" eventsView"正在向上和向下滑动,当我更改日历的高度时,标记日历边缘的白色边框线会发生变化但是日期不会缩放以占用整个空间,因为它是更大的还是比视图加载后小。任何帮助都会很棒,我在swift 3中工作,并通过可可豆荚安装fscalendar框架。

1 个答案:

答案 0 :(得分:1)

好吧,这是荒谬和错误的做法,但这是我本可以回家后半小时内如何设置高度而不改变库的唯一方法。

override func didRotate(from fromInterfaceOrientation: UIInterfaceOrientation) {
    super.didRotate(from: fromInterfaceOrientation)
    setupCalendarHeight()
}

func setupCalendarHeight() {
   let height = calendar.height-calendar.preferredHeaderHeight- calendar.preferredWeekdayHeight
    calendar.contentView.height = height
    calendar.daysContainer.height = height
    calendar.collectionView.height = height
    calendar.collectionViewLayout.invalidateLayout()
 }

如果有人知道更好的方法,请告诉我们。