在iOS 6中,即使您设置了自定义背景图像,也会在导航栏中自动添加投影.我很确定这不是iOS 5的情况,因为当我在iOS 5和6 sim中测试相同的代码时,阴影出现在iOS 6但不是5.
有人对这个有了解吗?或者如何启用/禁用它?
我希望UITabBar有一个宽度为5.0的顶部边框.边框应为黄色.我不想要任何左/下/右边框.
标签栏边框应该是平的(没有阴影或类似的东西).
如何删除阴影(图像)线?
在iOS 10上,此代码无法删除tabBar阴影线:
[[UITabBar appearance] setShadowImage:[[UIImage alloc] init]];
Run Code Online (Sandbox Code Playgroud)
有人知道,我该怎么做才能删除它?
在iOS 9.3这两行中删除该行,但iOS 10忽略setShadowImage命令.
任何人都有一个工作的解决方案来摆脱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
Run Code Online (Sandbox Code Playgroud)
我终于把手举到空中并将酒吧风格设置为"黑色"..这并没有摆脱边界,而是让它变白了.所以它隐藏了它.