0
我添加了一层阴影,以我的观点层像这样:将图层阴影裁剪为宽度而不是高度?
self.view.layer.shadowOffset = CGSizeZero;
self.view.layer.shadowOpacity = 0.10f;
self.view.layer.shadowRadius = 5.0f;
self.view.layer.shadowColor = [UIColor blackColor].CGColor;
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:
CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.bounds.size.width - 5.0, self.view.bounds.size.height)].CGPath;
self.view.clipsToBounds = NO;
我想要做的就是以某种方式剪辑阴影,使其不超出宽度,但超出的高度。基本上,我只想要一个90度的阴影,而不是我身边的阴影。我试着从bezierRect宽度中减去shadowRadius的量,但是这会让底部的阴影流变得有点混乱。
任何想法如何实现?