gpt4 book ai didi

ios - Mozharovsky 的 CVCalendar 日期不显示

转载 作者:搜寻专家 更新时间:2023-10-31 23:01:16 25 4
gpt4 key购买 nike

我的应用程序需要一个日历 View 。我决定通过 pod 文件使用 CVCalendar。但是问题是我可以得到出现的日子(星期日至星期六)但不是日期(1-19 ...)。

在我的 Controller 文件中我有:

import UIKit
import CVCalendar

class ViewController: UIViewController, CVCalendarViewDelegate, CVCalendarMenuViewDelegate {

@IBOutlet weak var calendarView: CVCalendarView!
@IBOutlet weak var menuView: CVCalendarMenuView!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.navigationController?.navigationBar

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

calendarView.commitCalendarViewUpdate()
menuView.commitMenuViewUpdate()
}


func presentationMode() -> CalendarMode {
return CalendarMode.MonthView
}

func firstWeekday() -> Weekday {
return Weekday.Sunday
}

最佳答案

这里是完整的代码

import UIKit
import CVCalendar

class TabEventsViewController: UIViewController, CVCalendarMenuViewDelegate, CVCalendarViewDelegate {

@IBOutlet weak var viewCalendar: CVCalendarView!
@IBOutlet weak var menuViewCalendar: CVCalendarMenuView!

func presentationMode() -> CalendarMode {
return CalendarMode.MonthView
}

func firstWeekday() -> Weekday {
return Weekday.Monday
}

override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()

viewCalendar.commitCalendarViewUpdate()
menuViewCalendar.commitMenuViewUpdate()
}


override func viewDidLoad() {
super.viewDidLoad()
self.view.layoutIfNeeded()


// Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/



}

这里有一些提示:

  1. 确保设置代表(2 个用于日历 View ,1 个用于日历菜单)
  2. 确保您的 uiview 没有负水平间距值

关于ios - Mozharovsky 的 CVCalendar 日期不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34664971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com