我在CollectionView
的单元格中有TableView
:
CollectionView
当我运行app f.e.在iPhone 5s我看到(单元格不适合屏幕):
我知道重用,但是如何从头开始显示单元格(适合屏幕)?
答案 0 :(得分:1)
您需要自动加载收藏视图
在TableViewCell实施方法
中 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()
}
我希望这对你有用,