Post

Replies

Boosts

Views

Activity

Reply to In SwiftUI, how to hide tab bar when a list is tapped to show a new view (without the tab bar)?
Placing the TabView in a NavigationView like @gcliu and @l\_o\_o\_l mentioned works. In addition, to solve @l\_o\_o\_l problem for the navigationBarTitle, all you need to do is pass the selection as the title, no need for the switch statement. Works if you specify your state variable as a string. And you can use large title with this solution. struct Dashboard: View {   @State private var selection = "Cards"       var body: some View {     NavigationView {       TabView(selection: $selection) {         CardList()           .tag("Cards")           .tabItem {             Image("cards")             Text("Cards")           }         Text("Profile Page")           .tag("Profile")           .tabItem {             Image("user")               .foregroundColor(.black)             Text("Me")           }       }       .navigationBarTitle(self.selection)     }   } } NB: The CardList() view contains the NavigationLink for each card.
Nov ’20