Open woozoobro opened 1 year ago
There's a .toolbar(.hidden, for: .tabBar) modifier.
.toolbar(.hidden, for: .tabBar)
Put this modifier in the destination View.
And then
In the ContentView
struct ContentView: View { @State private var selection: Int = 0 var body: some View { TabView(selection: $selection) { HomeView() .tabItem { Image(systemName: "house") } .toolbarBackground(.visible, for: .tabBar) .tag(0) NavigationStack { ForumView() } .tabItem { Image(systemName: "text.bubble") } .toolbarBackground(.visible, for: .tabBar) .tag(1) NavigationStack { ProjectsView() } .tabItem { Image(systemName: "folder.fill") } .toolbarBackground(.visible, for: .tabBar) .tag(2) LoginRootView() .tabItem { Image(systemName: "person.crop.circle") } .toolbarBackground(.visible, for: .tabBar) .tag(3) } .tint(Color.orange) .animation(.spring(response: 0.3, dampingFraction: 0.6), value: selection) .toolbar(.visible, for: .tabBar) }
.animation(.spring(response: 0.3, dampingFraction: 0.6), value: selection)
Put this animation in the TabView's selection property
Thanks very much for giving this important feedback to this project. I am sorry because I have not focused on iOS development for years and didn't reply your last question immediately.
hi,is support ios15
There's a
.toolbar(.hidden, for: .tabBar)
modifier.Put this modifier in the destination View.
And then
In the ContentView
.animation(.spring(response: 0.3, dampingFraction: 0.6), value: selection)
Put this animation in the TabView's selection property