简体   繁体   English

如何使UICollectionview出现在特定部分

[英]How make UICollectionview appearing at specific section

My problem is that I couldn't find the way to appear specific section of UICollectionview. 我的问题是我找不到找到UICollectionview特定部分的方法。

For example, 5 sections exsisted and I want to make 3rd section appearing at the beginning. 例如,存在5个部分,而我想使第3个部分出现在开头。

But 1st section only appeared and could not find the method to choose the section I want to show. 但首节才出现,但没有找到,选择我要显示部分的方法。

If anyone knows the way to solve this problem, please tell me how to solve it. 如果有人知道解决此问题的方法,请告诉我如何解决。

If you don't want to modify your datamodel to order sections, and show '3rd section' as '1st section', then you can use 如果您不想修改数据模型以订购部分,并且将“第三部分”显示为“第一部分”,则可以使用

scrollToItemAtIndexPath:atScrollPosition:animated: on UICollectionView. UICollectionView上的scrollToItemAtIndexPath:atScrollPosition:animated :。

You can pass [NSIndexPath indexPathForItem:0 inSection:2] assuming you have items in that section. 假设您在该部分中有项目,则可以传递[NSIndexPath indexPathForItem:0 inSection:2]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM