oOOMIAO 2013-05-15 02:29 采纳率: 10%
浏览 2310

cell第一次出现时不能画阴影

有一个带自定义单元的UICollectionView。其中有UIImageView 需要添加阴影。但是,在cell 出现在collection view又回去之后 ,才能开始画阴影。

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"genreCell";

GenreViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];

cell.genreImageView.layer.shadowRadius = 1.5;
cell.genreImageView.layer.shadowOffset = CGSizeMake(-1, -1);
cell.genreImageView.layer.shadowOpacity = 0.5;
cell.genreImageView.layer.shadowColor = [UIColor blackColor].CGColor;
cell.genreImageView.layer.shadowPath = [UIBezierPath bezierPathWithRect:cell.genreImageView.bounds].CGPath;
return cell;
}
  • 写回答

1条回答 默认 最新

  • 码界一棵葱 2016-08-19 02:41
    关注

    请问你的问题解决了么,我碰到和你一样的问题!

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog