ios - 我可以在容器中显示 EPCalendar 而不是全屏显示吗?

标签 ios swift calendar

您好,在此先感谢所有能够帮助我的人。 我正在使用 EPCalendarPicker(一个快速日历库),我想知道我是否能够在容器中显示日历,而不是它当前如何在我的其他内容上全屏打开。

    let navigationController = UINavigationController(rootViewController: calendarPicker)
    self.presentViewController(navigationController, animated: true, completion: nil)

有什么办法可以解决这个问题吗?

谢谢!

最佳答案

我想出了一个办法:

calendarPicker = EPCalendarPicker(startYear: currentYear, endYear: currentYear+2, multiSelection: false, selectedDates: [date!])
                calendarPicker.calendarDelegate = self // so the delegate methods work
                calendarViewer.addSubview(calendarPicker.view) // instead of presenting as a new VC, add the calendar picker view to your own custom view 
                calendarPicker.view.frame = calendarViewer.bounds // set the frame to the container's bounds

然后你就可以开始了。希望这有帮助

关于ios - 我可以在容器中显示 EPCalendar 而不是全屏显示吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35876202/

相关文章:

ios - 在 iOS 中检测不活动(无用户交互)以显示单独的屏幕,如覆盖

ios - 如何在didMoveToView(Swift,SpriteKit)中注册触摸?

ios - 如何在 iOS 中让线程休眠几秒钟?

ios - 每个约束项都必须是 View 或布局指南

ios - 将帐户存储到密码和帐户(iOS 设置)

iOS 应用程序在启动时崩溃

返回 12 小时格式的 Java 日历小时

java.util.calendar 表现奇怪

javascript - 为什么 `Temporal.Duration` 实例上的算术需要 `relativeTo` 引用日历日期?

ios - 如何将值从 UIView 的子类传递到 UIViewController 类