【发布时间】:2014-02-05 10:40:58
【问题描述】:
我使用了以下代码。
CAGradientLayer* collectionRadient = [CAGradientLayer layer];
collectionRadient.bounds = self.collectionView.bounds;
collectionRadient.anchorPoint = CGPointZero;
collectionRadient.colors = [NSArray arrayWithObjects:(id)[startColor CGColor],(id)[endColor CGColor], nil];
[self.collectionView.layer insertSublayer:collectionRadient atIndex:0];
但它绘制在包含图像的单元格上。所以没有显示单元格。
我想在 Cells 下绘制 UICollectionView 的渐变背景,并在视图滚动时修复它。 请告诉我。
【问题讨论】:
标签: ios objective-c uicollectionview gradient