swift 修改tabbar阴影,还有去掉导航栏和tabbar黑线

不废话了直接贴代码吧~

//修改tabbar阴影
  let path = CGMutablePath()
        path.addRect(self.tabBar.bounds)
        self.tabBar.layer.shadowPath = path
        path.closeSubpath()
        self.tabBar.layer.shadowColor = UIColor.white.cgColor
        self.tabBar.layer.shadowOffset = CGSize.init(width: 0, height: -5)
        self.tabBar.layer.shadowRadius = 5
        self.tabBar.layer.shadowOpacity = 0.8
        self.tabBar.clipsToBounds = true
//去掉黑线

        self.navigationController?.navigationBar.shadowImage = UIImage.init()
        self.tabBar.backgroundImage = UIImage.init()
        self.tabBar.shadowImage = UIImage.init()

你可能感兴趣的:(swift 修改tabbar阴影,还有去掉导航栏和tabbar黑线)