我必须创建类似于Appstore iOS应用程序的Grid视图.我想通过UICollectionView分页来做到这一点.我还实现了代码,但无法像这样滚动.
I have to create Grid view like Appstore iOS app. I want to do this with UICollectionView paging. I have also implemented the code but not able to scroll like that.
我想做的是在中心和左右两侧(左和右)有一个图像,它应该显示上一张和下一张图像的一部分.我已将UICollectionView的Frame设置为320 * 320.像元大小为290 * 320.(像元最小间距为10) 1
What I want to do is there will one image in Center and at both sides(left and right), it should show some portion of previous and next image. I have set Frame for UICollectionView is 320*320. cell size is 290*320.(cell min spacing is 10)1
下面是两个描述我的要求的链接.预先感谢.
Below are two links which depicts my requirement. Thanks in advance.
(这就是我想要的) 2
推荐答案您是否尝试过将UICollectionViewFlowLayout的滚动方向设置为水平?
Have you tried setting the scroll direction of your UICollectionViewFlowLayout to horizontal?
[yourFlowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
您将需要在集合视图上启用分页,如下所示:
You'll need to enable paging on your collection view like so:
[yourCollectionView setPagingEnabled:YES];
更多推荐
启用分页的UICollectionView
发布评论