UIScrollView内部的UICollectionView [英] UICollectionView inside of UIScrollView
问题描述
我有一个
- UIScrollView
- 标签
- 标签
- UICollectionView
我已禁用UICollectionViews滚动功能,因此我只想使用Scrollview滚动。我的问题是我不知道如何计算UICollectionViews的高度,所以我可以更新我的UIScorllView。如果它是UICollectionView中的许多元素,它会被剪裁。
I have disabled the UICollectionViews scrolling functionality, so I only want to scroll with the Scrollview. My problem is that I don't know how I can calculate the UICollectionViews height so I can update my UIScorllView. If it's many elements inside the UICollectionView, it's get clipped.
我创建了这个小HTML示例来显示我正在寻找的东西
http://jsfiddle.net/hDwPH/I have created this little HTML example to show what I'm looking for http://jsfiddle.net/hDwPH/
Dummy code
推荐答案
所以我的建议将使用单个UIScrollview。创建您自己的视图(我们称之为A),无论您想要在Collection视图中重复播放什么,并将SubSubview A反复添加到UIScrollview中,无论您想要多次。
So my suggestion would be to use a single UIScrollview. Create your own view (we'll call it A) with whatever you are trying to repeat in the Collection view and addSubview A to the UIScrollview over and over for however many times you want.
另一种想到的方法是完全使用collectionview创建两个collectionviewcells,一个带有你的标签,你只显示第一个单元格,另一个集合视图显示所有其他单元格
Another way that just came to mind would be to use entirely a collectionview create two collectionviewcells, one that has your labels and you only display it for the first cell and the other collectionviewcell for all the others
这篇关于UIScrollView内部的UICollectionView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!