iOS - Getting desired shadow above UITabBar

后端 未结 6 1699
执笔经年
执笔经年 2021-02-12 19:22

I am trying to get my tab bar shadow to look like the one seen in this image:

What is the best way of doing thi

6条回答
  •  伪装坚强ぢ
    2021-02-12 20:05

    For Swift 5 :

    tabBar.layer.shadowOffset = CGSize(width: 0, height: 0)
    tabBar.layer.shadowRadius = 2
    tabBar.layer.shadowColor = UIColor.black.cgColor
    tabBar.layer.shadowOpacity = 0.3
    

提交回复
热议问题