我有一个ViewController,在这个控制器中有两个UIView。
我想在第一个UIView底部添加阴影,该阴影显示在第二个UIView上。
first UIView
-------------
<- shadow here
secondUIView
但是当我仅仅添加这段代码时,它并没有起作用。
firstView.layer.masksToBounds = true
firstView.layer.shadowOffset = CGSizeMake(0,5)
firstView.layer.shadowOpacity = 0.5
firstView.layer.shadowPath = UIBezierPath(rect: firstView.bounds).CGPath
shadowOpacity
,它默认为0。 - onmyway133