Dynamic height of uicollectionview according to row values

Hi friends, I am using the collection view in the iPhone app to display a list. I want to set the height of the collection view according to the size of my list. how can i install it?

also there is a problem when I use the set selected cell method in the collection view, it will disable user interaction.

I do not know the reason? Thank.

+4
source share
4 answers

"set the selected cell method as a collection, it will disable user interaction.

this is solved by adding the following method.

[newCell setSelected:YES]; 

[collectionView selectItemAtIndexPath:indexPath animated:YES scrollPosition:UICollectionViewScrollPositionNone];

respectively.

UICollectionView

.

+5

, , .

dynamicHeight  =  collectionView.contentSize.height
0

heightforrowatindexpath

return [array count]*(your cell content height);
0

UICollectionView , UITableView, RZCellSizeManager , .

0

All Articles