What's the best way to add a drop shadow to my UIView

前端 未结 7 1169
自闭症患者
自闭症患者 2020-12-04 05:20

I am trying to add a drop shadow to views that are layered on top of one another, the views collapse allowing content in other views to be seen, in this vein i want to keep

7条回答
  •  时光取名叫无心
    2020-12-04 05:58

    The trick is defining the masksToBounds property of your view's layer properly:

    view.layer.masksToBounds = NO;
    

    and it should work.

    (Source)

提交回复
热议问题