我正在制作一个日历应用程序,如何让每个事件根据事件的长度以不同的大小显示?
因此,我们使用过的每个日历应用程序都可以让您将事件添加到日程中,然后您会看到一个带有事件标题的彩色矩形,其大小取决于其长度。因此,如果活动从 1:00 到 1:45 运行,则矩形仅占用小时时段的 3/4。
使用 EventKit 和 EventKitUI,我意识到制作事件将非常容易,现在我想知道下一步,即以图形方式使我的事件对用户可见。
我计划只使用一个简单的 UITableView 作为我的日视图,所以当我添加一个事件时,我该如何以图形方式表示它?我在这里寻找一些关于实施的想法。我不知道我怎么能做到这一点。是否需要制作自定义标签并将其添加到所选单元格的顶部?
我意识到编程的一部分是知道如何做某事,另一个是知道要做什么。在这一点上,我正在努力解决“做什么”部分,因为我认为如果我有一个方向,我可以用代码来完成它,没有问题。
有什么想法吗?
So every calendar app out there that we have all ever used lets you add events to your schedule, and then you see a color rectangle that shows up with the event title, and it is sized depending on its length. So if an event runs from 1:00-1:45, the rectangle only takes up 3/4 of the hour slot.
Using EventKit, and EventKitUI, I have realized that making the events is going to be quite easy, now I am wondering about the next step, which is graphically making my events visible to the user.
I plan on just using a simple UITableView for my day view, so when I add an event, how could I go about representing that graphically? I am looking for some ideas on implementation here. I don't know how I could do this. Would it be a matter of making a custom label and adding it to the top of the selected cell?
I am realizing that programming is partly a problem of knowing how to do something, and the other is knowing what to do. At this point, I am struggling with the what to do part, because I think that if I had a direction, I could do it in code no problem.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这个。
https://github.com/klazuka/Kal
我使用了示例代码并在上面扔了一块手表在 gitHub 上,因为我喜欢他所做的事情。做一些日历功能,也许可以帮助你得到一些想法。
Check this out.
https://github.com/klazuka/Kal
I played with the sample code and threw a watch on it on gitHub because I liked what he did. Does some calendar functions, maybe it can help you get some ideas flowing.