iOS - Getting desired shadow above UITabBar

后端 未结 6 1700
执笔经年
执笔经年 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:14

    I'd prefer to use a dedicated tab bar methods.

    // Set `backgroundImage` to be able to use `shadowImage`
    tabBar.backgroundImage = UIImage.imageWithColor(.white)
    tabBar.shadowImage = #imageLiteral(resourceName: "tab_bar_shadow") // 2x34pt works for me
    

提交回复
热议问题