Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个显示月份和日期的日历。我不想使用 API 或库。我想弄清楚如何创建日历的算法。
最快的方法是计算一个月的天数,然后编写一个例程,像日历应用程序一样以图形方式显示这一天。
您可以使用一个例程来显示UIButton每一天并将其显示为虚拟网格。在每一行中,您应该显示 7 天(从周日到周六),然后在下一行显示接下来的日子。
UIButton