有人有一个有效的解决方案来消除 iOS 10 中的这个边框吗?我有一个自定义的 UITabBar 背景图像。
我已尝试以下操作但没有结果:
tabBar.backgroundImage = UIImage(named: "myBackgroundImage.png")
tabBar.shadowImage = nil
tabBar.shadowImage = UIImage()
// i've also tried combinations of this in the storyboard directly
我最终把手举到空中并将栏样式设置为“黑色”..这并没有消除边框,而是使其变成白色。所以它隐藏了它。
如果你使用backgroundImage那么阴影线就会出现
所以你可以尝试这个:
self.tabBar.backgroundImage = UIImage()
self.tabBar.shadowImage = UIImage()
let tabBarView = UIImageView(image: #imageLiteral(resourceName: "YOUR_IMAGE"))
tabBarView.frame = CGRect(x: 0, y: 49 - IMAGEHEIGHT, width: SCREENWIDTH, height: IMAGEHEIGHT)
self.tabBar.addSubview(tabBarView)
self.tabBar.sendSubview(toBack: tabBarView)
它对我有用
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)