gpt4 book ai didi

ios - uicollectionview 的动态高度根据行值

转载 作者:可可西里 更新时间:2023-11-01 05:34:53 26 4
gpt4 key购买 nike

你好 friend 我在 iPhone 应用程序中使用 Collection View 来显示列表。我想根据列表的大小设置 Collection View 的高度。我该如何设置它?

当我在 Collection View 中使用单元格的设置选定方法时也会出现问题,它将禁用用户交互。

不知道是什么原因?谢谢。

最佳答案

“在 Collection View 中设置单元格的选定方法将禁用用户交互。”

这是通过添加以下方法解决的。

[newCell setSelected:YES]; 

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

因此。

按照此链接中给出的

UICollectionView Select and Deselect issue

谢谢。

关于ios - uicollectionview 的动态高度根据行值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25762761/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com