【问题标题】:How do I scale the height of FSCalendar?如何缩放 FSCalendar 的高度?
【发布时间】:2018-02-14 14:06:30
【问题描述】:
我在我的项目中使用FSCalendar,我想知道如何使我的日历缩放到正在动画的新高度?我有一个上下滑动的“eventsView”,当我更改日历的高度时,标记日历边缘的白色边框线会发生变化,但日期不会缩放以占用整个空间比视图加载后更大或更小。任何帮助都会很棒,我正在使用 swift 3,并且 fscalendar 框架是通过可可豆荚安装的。
【问题讨论】:
标签:
ios
swift
swift3
scaling
fscalendar
【解决方案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()
}
如果有人知道更好的方法,请告诉我们。