首页 > 解决方案 > 如何在 FSCalendar(Swift 5.0) 中增加特定日期的突出显示颜色

问题描述

我正在尝试增加 FSCalendar 中特定日期的突出显示颜色的大小。下面是正在使用的代码也正在附加。请让我知道我缺少什么。谢谢

func setUpCalendar() {
        calendar = FSCalendar(frame: CGRect(x: 20, y: 150, width: self.view.frame.size.width - 30, height: 150))
        calendar.scrollDirection = .horizontal
        calendar.scope = .week
        calendar.allowsMultipleSelection = false
        calendar.appearance.separators = .interRows
        calendar.rowHeight = 30.0
        calendar.appearance.headerTitleColor = UIColor(hex: "FF7271")
        calendar.appearance.todayColor = UIColor(hex: "FF7271")
        calendar.appearance.selectionColor = UIColor(hex: "FFEFEF")
        calendar.appearance.titleSelectionColor = .black
        calendar.appearance.weekdayTextColor = .systemGray
        calendar.appearance.headerMinimumDissolvedAlpha = 0
        calendar.appearance.headerTitleFont = UIFont(name: "System", size: 0)
}

标签: swift

解决方案


像这样躲起来。转到storyboard/xib您使用的内容。

goto design -> go to Atrributed inspector and set header height = 0 

在此处输入图像描述

根据您以编程方式定义它,而不仅仅是写这一行

calendar.headerHeight = 0

推荐阅读