0

Is there a way to remove the Tabbar from a page?

enter image description here

The flow I have is to start session .. have a page with a menu of three tabs,

one of them is the profile page in it is the logout, what I do here is: clear the UserDefaults and navigate back to the login screen, but here I get back in the tab bar

TabView:

TabView{
                MainUIView()
                    .tabItem{
                        Image(systemName: "house")
                        Text("main9")
                    }
                Text("Inserte su anuncio AQUI!")
                    .tabItem{
                        Image("aidi")
                        Text("Hello")
                    }
                ProfileUIView()
                    .tabItem{
                        Image(systemName: "person.fill")
                        Text("perfil")
                    }
            }
            .accentColor(Color("blueColor"))

my code NavigationLink in Profile

NavigationLink(destination: LoginUIView()
                                                    .navigationTitle("")
                                                    .navigationBarHidden(true)
                                                    .navigationBarBackButtonHidden(true)) {
                                        HStack(alignment: .center){
                                        Image("exit")
                                            .resizable(resizingMode: .stretch)
                                            .frame(width: 30.0, height: 30.0)
                                            .padding(.top,UIScreen.main.bounds.width / 5)
                                            .padding(.trailing,50)
                                            
                                        }
  • Can you be more specific about what is wrong with your code? A screenshot if possible – barryalan2633 Oct 15 '21 at 06:24
  • It does not work that way. TabView and LoginUiView need to have seperate NavigationViews. Have a look at these https://stackoverflow.com/questions/68117105/only-back-button-visible-on-custom-navigation-bar-swiftui https://stackoverflow.com/questions/68209078/swiftui-how-to-add-toolbars-to-tabview-tabs-inside-a-navigationview – mahan Oct 15 '21 at 07:07
  • You need a variable to keep track of your users logged in state, and then make the `TabView` conditional on that. Essentially, If `loggedIn` then `TabView` else `LogInView` – Yrb Oct 15 '21 at 12:10

0 Answers0