add Shadow on UIView using swift 3

后端 未结 18 1288
攒了一身酷
攒了一身酷 2020-11-30 19:49

prior swift 3 i was adding shadow in my UIView like this :

//toolbar is an UIToolbar (UIView)
toolbar.layer.masksToBounds = false
toolbar.layer.shadowOffset          


        
18条回答
  •  既然无缘
    2020-11-30 20:18

    After spent lot of hours, I just find out the solution, just add this simple line.

    backgroundColor = .white

    Hope this help you!

提交回复
热议问题