iOS - Getting desired shadow above UITabBar

后端 未结 6 1785
执笔经年
执笔经年 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条回答
  •  萌比男神i
    2021-02-12 20:10

    You can give shadow by using following code to any UI object

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

    Here i gave example for your tabControl object.

提交回复
热议问题