UICollectionView部分中的单元格数目(UICollectionView number of cells in the section)

编程入门 行业动态 更新时间:2024-10-28 22:23:36
UICollectionView部分中的单元格数目(UICollectionView number of cells in the section)

如何计算该部分中的单元格数量? 我需要知道在单元选择过程中单元的数量。

How to count the number of cells in the section? I need to know the number of cells in the section during the cell selection.

最满意答案

使用此方法作为集合视图来查找节中的项目数量

- (NSInteger)numberOfItemsInSection:(NSInteger)section;

你可以使用你的UICollectionView对象来调用它。

NSInteger numberOfItems = [myCollectionView numberOfItemsInSection:2];

其中2是您想要查找项目数量的部分。

Use this method for the the collection view to find number of items in a section

- (NSInteger)numberOfItemsInSection:(NSInteger)section;

You can call it using your UICollectionView object as.

NSInteger numberOfItems = [myCollectionView numberOfItemsInSection:2];

Where 2 is the section for which you want to find the number of items.

更多推荐

本文发布于:2023-07-26 18:24:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279306.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数目   单元格   UICollectionView   section   cells

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!