如何在选定的UicollectionView单元格上显示计数标签?
我有一个CalendArcollectionView,它显示为每月日历类似于iOS日历。因此,在该日历上,我必须显示用户以前已经选择的预选日期。但是我还需要将标签显示为对这些单元的限制(假设如果用户的预选为23,24,25,26,则在这些datecell用户上也应将1,2,3,4分别为右角标签。 )。 我该怎么做? “ alt =”请参考附带的图像以获取更多理解”>
I have a CalendarCollectionView, which shows up as monthly calendar similar like iOS Calendar. So on that Calendar i have to show the PreselectedPeriod dates which user has already selected before. But i also need to show a label as a count on these cells (let's assume if user has Preselected values as 23,24,25,26 so on these dateCell user should also see 1,2,3,4 as right corner label respectively).
How can i do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您已经选择了日期,则可以根据需要使用以下逻辑而在几乎没有修改的情况下使用以下逻辑。
您可以声明助手变量
cellforintemat
看起来像这样。注意:在这里我使用
indexpath
作为日历日期If you have already selected dates you can use the following logic with little modifications according to your requirement.
You can declare the helper variables
Your
cellForIntemAt
looks like this.Note: Here I have used the
indexPath
as the calendar date