uicollectionview的动态高度,按行值

Pre*_*ani 4 iphone objective-c ios sizetofit uicollectionview

你好朋友我在iPhone应用程序中使用集合视图来显示列表.我想根据列表的大小设置集合视图的高度.我怎么设置它?

当我在集合视图中使用set selected method of cell时它也会出现问题,它会禁用用户交互.

我不知道是什么原因?谢谢.

Pre*_*ani 5

"在集合视图中设置选定的单元格方法,它将禁用用户交互."

这可以通过添加以下方法来解决.

[newCell setSelected:YES]; 

[collectionView selectItemAtIndexPath:indexPath animated:YES scrollPosition:UICollectionViewScrollPositionNone];
Run Code Online (Sandbox Code Playgroud)

因此.

按照此链接中的给定

UICollectionView选择和取消选择问题

谢谢.