Post

Replies

Boosts

Views

Activity

Reply to SwiftUI hidesBottomBarWhenPushed equivalent?
Update : Something exist on iOS 16+ with SwiftUI : you can use the modifier .toolbar(.hidden, for: .tabBar). Here's an example : struct ContentView: View { var body: some View { TabView { view1 .tabItem { Label("View 1", systemImage: "house") } view2 .tabItem { Label("View 2", systemImage: "square.and.pencil") } } } var view1: some View { NavigationStack { NavigationLink("Push") { Text("View 2!") .toolbar(.hidden, for: .tabBar) } } } var view2: some View { NavigationStack { Text("Another view") } } } It works, but it's not perfect : the tab view disappear without any animation (with UIKit the tab view was going with the view who disappear) wen you go back to the previous view, the tab view come back after the view appeared (who move all of your content to the top) In video :
Apr ’23
Reply to SwiftUI hidesBottomBarWhenPushed equivalent?
Hi @southbayj, Thanks for you answer. I tried to do that, but because you have only one NavigationView, you also have only one title. So if you set a title to your NavigationVIew, you can't edit it anymore. To fix this, I tried to use a @State variable, and at first it was working, but then I have some UI glitch with the NavigationView (like in my GIF). So it was not a solution for me...
Aug ’22