admin管理员组文章数量:1125049
There was a problem that I had not encountered before, in our project in some places it is necessary to hide the tabbar, while the development was in progress we did not experience any problems, since we tested on iOS 16 and 17. To hide the tabbar we used the standard modifier .toolbar (.hidden, format: .tabbar). On iOS 16 and 17 there is no problem, everything works correctly, but in the case of iOS 18 it simply does not hide, it hides correctly only if you install the modifier in the root view, for example:
For iOS 16 and 17:
struct SomeView: View {
VStack {
Text("123")
.toolbar(.hidden, for: .tabbar)
}
}
It worked, but dont work on iOS 18, i tried to use new API method in same place (.toolBarVisibility(.hidden, for: .tabbar)) - but it dont work.
Then I try to use this modifier in Root View in my tabbar:
struct TabBar: View {
var supportView: some View {
NavigationStack(path: $coordinator.path) {
SupportView()
// for example here - .toolbarVisibility(.hidden, for: .tabBar) - it
// work, but i need setup this in another screen of this flow 3 or 4 screen in
// hierarchy
.navigationDestination(...) { screen in
coordinator.buildProfileScreen(screen)
.navigationBarBackButtonHidden()
}
}
}
}
this will work for supportview but i need tabbar hiding to work on 3rd screen in flow support
本文标签: swiftSwiftUI Tabbar not hiding on iOS 18Stack Overflow
版权声明:本文标题:swift - SwiftUI Tabbar not hiding on iOS 18 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736641920a1946014.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论