Using a UICollectionView to build a Monthly/Weekly calendar

被刻印的时光 ゝ 提交于 2019-12-22 01:28:03

问题


I want to build a calendar using a UICollectionView. The calendar should have two layouts: Weekly - 7 days with paging. Should be horizontally scrollable. Monthly - full month with paging. Should be horizontally scrollable.

I want a "numbers only" calendar - something that works like the iOS native calendar (without the full daily schedule - just the numbers)

The user should be able to move from layout to layout by dragging the bottom of the collection view (making the week bigger to see a full month view, making the month smaller to see a week view)

I tried solving this but encountered a few issues:

  1. When the watching the monthly view (horizontal scrolling) the days are shown in columns (2nd day is under the 1st day instead of to the right)
  2. Transitioning between the two layouts never looks good enough (I don't want days to appear and fly into screen - I want it to just appear from the top and bottom while the collection view is getting bigger)

回答1:


UICollectionView is a good idea. But , it might take you a while. That is a good example from cocoa controls link




回答2:


I don't know if you have found a solution to this answer yet but, if you still need an example (and you use CocoaPods), you can head to the cocoapod site and do a search for calendars. You can find a list to choose from at ->> Cocoapds.org. There are some in this list that do exactly what you want to do. You can use them in your project, or you can roll your own by using them as an example. Rolling your own may take some time though.



来源:https://stackoverflow.com/questions/33119983/using-a-uicollectionview-to-build-a-monthly-weekly-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!