Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
690 views
in Technique[技术] by (71.8m points)

ios - UICollectionView inside of UIScrollView

I have a

  • UIScrollView
    • Labels
    • Labels
    • 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.

I have created this little HTML example to show what I'm looking for http://jsfiddle.net/hDwPH/

Dummy code
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...