the behavior of the UICollectionViewFlowLayout is not defined, because the cell width is greater than collectionView width

后端 未结 20 2196
温柔的废话
温柔的废话 2020-12-01 01:53

2015-08-18 16:07:51.523 Example[16070:269647] the behavior of the UICollectionViewFlowLayout is not defined because: 2015-08-18 16:07:51.523
Example

20条回答
  •  庸人自扰
    2020-12-01 02:22

    This solution definitely works.. Try this code

    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) 
    
    {
    
     collectionView.collectionViewLayout.invalidateLayout()
    
     super.viewWillTransition(to: size, with: coordinator)
    
    }
    

提交回复
热议问题