I want a collectionview cell should be the dynamic height. I am getting data from server and loading in to tableview inside collectionview cell. That cell height should be change according to the table cell height, I am getting till here. But the problem is The cells are not aligning from the top. see this pic. The cell should create from top. This is demo code. Thanks
Asked
Active
Viewed 148 times
0

rmaddy
- 314,917
- 42
- 532
- 579

user2408165
- 13
- 2
-
https://www.facebook.com/photo.php?fbid=652366928166381&set=p.652366928166381&type=1 this is my image reference – user2408165 Apr 08 '14 at 12:07
-
Don't put your code behind a link that requires a sign in. Add it to your question. – jrturton Apr 08 '14 at 14:26
2 Answers
0
If I'm understanding your problem correctly, try setting self.yourCollectionView.automaticallyAdjustsScrollViewInsets = false

Grant Park
- 1,004
- 1
- 9
- 29
0
You will need to extend UICollectionViewLayout. And then in the prepareLayout method, you will need to specify the calculated frames of every item of your collectionview. There are two tutorials: http://www.skeuo.com/uicollectionview-custom-layout-tutorial is a very good tutorial for custom layout.
https://github.com/betzerra/MosaicLayout and https://www.cocoacontrols.com/controls/rfquiltlayout is pretty much what you want. A related question about rfquiltlayout on stackoverflow is RFQuiltLayout and UICollectionView