UPCarouselFlowLayout icon indicating copy to clipboard operation
UPCarouselFlowLayout copied to clipboard

The behavior of the UICollectionViewFlowLayout is not defined because:

Open muratyilmaz opened this issue 8 years ago • 3 comments

Hi, When i rotate device to landscape mode always taking this warning? Thanks.

The behavior of the UICollectionViewFlowLayout is not defined because: 2017-01-24 02:57:44.553 UPCarouselFlowLayoutDemo[32030:325685] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.

muratyilmaz avatar Jan 24 '17 00:01 muratyilmaz

@muratyilmaz, Verified warning and getting the same issue in the demo project, any ideas to fixing this error?

leojkwan avatar Apr 20 '17 02:04 leojkwan

@leojkwan This warning is annoying. Once you have to override "viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)" function in your ViewController class. Then, inside that function,you have to invalidate your layout in order to recreate and equalize zero sectionInset property of your layout.

Then, implement UICollectionViewDelegateFlowLayout collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize Inside above function, recalculate item size.

i'am sory. My english is not very well. i hope, you can understand :)

muratyilmaz avatar Apr 20 '17 08:04 muratyilmaz

cek your Insets, maybe like this, u must be set to 0

self.colectionView1.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)

or this screen shot 2018-02-17 at 20 52 33

i hope help you

jerrypm avatar Feb 17 '18 13:02 jerrypm