Swift Tabbar无法正确显示
在Xcode中,我有此应用程序使用TabBariTem。有5个项目,偶尔我在特定页面上时会得到Tabbaritems的奇怪覆盖(请参阅图片)。我偶尔说,因为它并不总是这样做,但仍然很频繁。不确定这只是Tabbaritem的限制还是我有错误。
正如您在第二张图像中看到的那样,塔巴尔被叠加到其他文本上,而不是在其后面消失。奇怪的是,每个选项卡的行为不同。
我可以解决这个问题,
if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .black
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = UITabBar.appearance().standardAppearance
}
但需要一个适用于iOS 11+的修复程序
In Xcode I have this app that uses tabBarItem. There are 5 items and occasionally when I'm on a specific page I get this weird overlay of the tabBarItems (see pictures). I say occasionally, because it does not do it always but it is still very frequent. Not sure if it is just a limitation with tabBarItem or if I have a bug.
This is how it SHOULD NOT look, but does:
As you can see in the second image the tabBar is being overlayed onto the other text rather than disappearing behind it. It's odd that it behaves differently for each tab.
I can fix the issue with
if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .black
UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = UITabBar.appearance().standardAppearance
}
But need a fix that would work for IOS 11+
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)