2017-05-25 61 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

謝謝,它真的按我的意願工作。大! –