Search code examples
iosswiftfscalendar

FSCalendarScopeWeek issue- swift


I'm using fscalender on my project which I have to use both month scope and week scope on different view controller.so when I'm using week scope date title size is getting smaller, but when I increase the view height its getting perfect.but my view should have an fixed size so how can I fix this problem.

this is my calendar now

here I converted the round background to rectangle by

calendarObj.appearance.borderRadius = 0

The above week title is implemented with stackview.

This is actually I want

the rectangle border is not showing full.How to resolve this?Im new to this iOS


Solution

  • I Tried This On A view, I have Added only Few Lines, an it is working as you want.

        calendarView.dataSource = self
        calendarView.delegate = self
        calendarView.scrollDirection = .vertical
        calendarView.scope = .week
        calendarView.backgroundColor = .clear
        calendarView.allowsMultipleSelection = false
        calendarView.appearance.selectionColor  = .none
        calendarView.appearance.borderSelectionColor = .red
        calendarView.appearance.todayColor = .clear
        calendarView.appearance.titleTodayColor = .black
        calendarView.appearance.weekdayTextColor = .black
        calendarView.appearance.borderRadius = 0.2
    

    Check My Output

    Here's Another Image

    I Hope This Will Help.