ios - 当具有动态单元格高度的 UITableview 放置在里面时,如何扩展/缩小 UICollectionViewCell 高度?

标签 ios swift uitableview uicollectionview

我在 UICollectionViewCell 中有一个 UITableView。我正在将远程 RSS 提要加载到我的表格 View 中。最初,UICollectionViewCell 高度等于 tableview 高度。但是,当加载数据并且 TableView 中的单元格展开时,UICollectionViewCell 不会展开。

注意:我从主线程调用 collectionView.reloadData(),所以这不是问题。

最佳答案

我认为您需要使用此 UICollectionViewDelegateFlowLayout 方法在加载表格后提供新的高度:

- collectionView:layout:sizeForItemAtIndexPath:

关于ios - 当具有动态单元格高度的 UITableview 放置在里面时,如何扩展/缩小 UICollectionViewCell 高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37263023/

相关文章:

ios - 在 watchOS 2 扩展中创建的 Realm 浏览器中打开 Realm 文件

swift - 收到一封来自 Apple 的电子邮件,其中指出我使用相同的 swift 库

swift - 使用 removeAtIndex 在 Swift 中索引超出范围

ios - 具有动态 subview swift 的 UITableViewCell 高度

ios - 从嵌入在 tableView 中的 collectionView 显示 xib

iphone - 使用触摸事件的 locationInView 时,如何确定设备上 CGPoint 的有效范围?

ios - TableView 单元格中的 UIButton 操作

ios - IBInspectable UIEdgeInsets 未显示在 IBOutlet 中

ios - UISegmentedControl 内部 View 应在显示 View 后调用 API

iphone - 来自自定义单元格选定颜色的 UILabel 阴影