2017-05-25 63 views
0

CollectionViewTableView细胞: enter image description here细胞不适合在屏幕

enter image description here

约束的细胞在CollectionView

enter image description here

当我运行的应用程序F.E.在iPhone 5S我看到(电池不适合在屏幕上): enter image description here

但滚动向下和向上后,我看到: enter image description here

我知道重用,但如何显示从开始的绝细胞(适应屏幕)?

+0

这是否适合您?下面的答案? – Dhiru

回答

1

你需要reaload您的收藏观

在你TableViewCell Impleament方法

func draw(_ rect: CGRect) 
    { 

// here you have to reaload your collectionView 
     super.draw(rect) 
    self.collectionView.realodData() 

    } 

刷新你的TableCell通过调用它的drawRect方法

optional func tableView(_ tableView: UITableView, 
      willDisplay cell: UITableViewCell, 
       forRowAt indexPath: IndexPath) 
{ 
    cell.setNeedsDisplay() 
} 

我希望这会为你工作,

+1

谢谢,它真的按我的意愿工作。大! –