問題描述如下:

出現以上問題:
the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
主要是因為我使用了UICollectionView,并且用了UICollectionViewFlowLayout,才會報錯,說是item的寬度不可以大于UICollectionView的寬度
解決方法,就是在原來的寬度基礎上-10就好了,如下: