【发布时间】:2017-01-18 12:36:37
【问题描述】:
我正在尝试制作所有侧面的阴影,但它仅适用于底部和右侧。知道我缺少什么吗? 这是我的代码
cell.layer.shadowColor = [UIColor lightGrayColor].CGColor;
cell.layer.shadowOffset = CGSizeMake(2.5f, 2.5f);
cell.layer.shadowRadius = 3.0f;
cell.layer.shadowOpacity = 0.5f;
cell.layer.masksToBounds = NO;
【问题讨论】:
-
因为你设置了
shadowOffset。 stackoverflow.com/questions/27038559/… -
将 uiview 放在集合视图单元格上,然后给该视图添加阴影
-
将您的
UICollectionViewclipsToBounds设置为NO。
标签: ios objective-c swift shadow