cell可能出现border的宽度不一致。
如下:cell的border设置为0.5f
原因:
//定义每个UICollectionView 的大小
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat width = self.coursesCollectionView.frame.size.width / kNumOfTimePerDay;
CGFloat height = self.coursesCollectionView.frame.size.height / kNumDaysPerWeek;
return CGSizeMake( width, height);
}
每个cell的宽度和高度被挤得不一致。
解决方案:
1. 给UICollectionView使用backgroundView。(但backgroundView不能随着cell滑动)。
2. 令每个cell的宽度和高度不要采用以上方法计算得出,使之不用被挤。(图示情况暂无法解决)