iOS - Getting desired shadow above UITabBar

后端 未结 6 1709
执笔经年
执笔经年 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 19:59

    Swift 4:

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

提交回复
热议问题