【发布时间】:2016-04-30 16:35:18
【问题描述】:
我需要在我的收藏视图中添加一个底部阴影,这是我的代码:
weakself!.layer.shadowPath = UIBezierPath(rect: weakself!.bounds).CGPath
weakself!.layer.masksToBounds = false
weakself!.layer.shadowOffset = CGSizeMake(0.0, 3.0);
weakself!.layer.shadowColor = UIColor.blackColor().CGColor
weakself!.layer.shadowOpacity = 0.5
上面的代码与其他视图完美配合。但它使集合视图滚动到它的边界之上。正如您在下面的图片中看到的那样,集合视图在搜索栏上方滚动:
【问题讨论】:
-
你有没有试过给导航栏添加阴影,而不是集合视图
-
@RohitPradhan 感谢您的评论。不,我已添加到集合视图中
标签: ios ios7 ios8 uicollectionview ios9