CollectionView的单元格不适合屏幕
我在TableView
单元格中有CollectionView
:
CollectionView
单元格的约束
当我在iPhone 5s上运行app fe时,我发现(单元格不适合屏幕显示):
但是,滚动后,我看到:
我知道重用,但如何显示细胞从开始必须(适合屏幕)?
你需要reaload你的collections视图
在你的TableViewCell Impleament方法中
func draw(_ rect: CGRect) { // here you have to reaload your collectionView super.draw(rect) self.collectionView.realodData() }
通过调用DrawRect方法来刷新TableCell
optional func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { cell.setNeedsDisplay() }
我希望这会为你工作,