UIView with rounded corners and drop shadow?

前端 未结 30 3174
一整个雨季
一整个雨季 2020-11-22 08:00

I’ve been working on an application for a couple of years and received a simple design request: Round the corners on a UIView and add a drop shadow.To do as given below.

30条回答
  •  半阙折子戏
    2020-11-22 08:37

    The answer provided by Evan Mulawski will work perfectly. The catch is that you have to set the background color for the view to clearColor and the masksToBounds property to NO.

    You can set whatever color you want for the view, set it like

    v.layer.backgroundColor = your color;
    

    Hope this helps..

提交回复
热议问题