1
    NavigationView{
            VStack (spacing: -3){
                UserImage()
                Spacer()
                VStack(spacing:50){
                    Version()
                    VStack( spacing:25){
                        VStack(alignment: .leading, spacing:10){
                            TextField("Username", text:$username)
                                .font(Font.custom("Quicksand-SemiBold",size: 16))
                            Line()
                            
                        }
                        .padding([.leading, .trailing])
                        
                        VStack(alignment: .leading, spacing:10){
                            SecureField("Password", text:$password)
                                .font(Font.custom("Quicksand-SemiBold",size: 16))
                            Line()
                            
                        }
                        .padding([.leading, .trailing])
                        //                        NavigationLink(destination: HomeScreen(), tag: 1, selection: $selection) {
                        
                        Button(action: {print("Button Tapped")}){
                            SigninButtonContent()
                        }
                        //                        }
                        
                        HStack(spacing: 5){
                            Text("If you are new to AT Broadband")
                                .font(.subheadline)
                                .fontWeight(.regular)
                                .frame(width: 225)
                            
                            Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/, label: {
                                TapHere()
                                
                            })
                        }
                        
                        Spacer()
                    }
                    .padding(.horizontal, 50)
                    
                }
                //Suzhiyam Card
                VStack{
                    HStack{
                        
                        CardView()
                        Spacer()
                    }
                    .padding(.bottom)
                    
                }
                
            }
            .navigationBarHidden(true)
        
    }
}

}

struct SigninButtonContent: View {
let login = HomeScreen()

var body: some View {
    HStack{
        NavigationLink(destination: HomeScreen()) {
            Text("SIGN IN")
                .font(.headline)
                .foregroundColor(Color.white)
                .padding()
                .frame(width: 100.0, height: 40.0)
                .background(/*@START_MENU_TOKEN@*//*@PLACEHOLDER=View@*/Color(red: 0.931, green: 0.213, blue: 0.228)/*@END_MENU_TOKEN@*/)
                .cornerRadius(35.0)
                .shadow(radius: 2,x:0,y: 3 )
        }
    }
}

}

This was my login screen code i have some doubts in NavigationView for screens. I have custom back button to use, so i used

.navigationBarHidden(true)
.navigationBarBackButtonHidden(true)

Still no use back button was still there.This is my login screen, After clicking Sign In button it Navigated to Home Screen

struct HomeScreen: View {
var body: some View {
    NavigationView{
        ScrollView{
            ZStack{
                lightGreyColor
                    .edgesIgnoringSafeArea(.all)
                VStack{
                    ZStack{
                        VStack(spacing: -90){
                            Image("OnePlus-6")
                                .resizable()
                                .aspectRatio(CGSize(width: 19, height: 9), contentMode: /*@START_MENU_TOKEN@*/.fill/*@END_MENU_TOKEN@*/)
                                .frame(width: 340, height: 190)
                                .edgesIgnoringSafeArea(.top)
                                .overlay(RectangleTest())
                            VStack{
                                PlanCard()
                            }
                        }
                    }
                    VStack{
                        CustomerContact()
                    }
                    VStack(spacing:15){
                        VStack{
                            HStack{
                                InfoCard()
                            }
                        }
                        VStack{
                            HStack{
                                ScreenCard()
                            }
                        }
                        VStack{
                            HStack{
                                InfoCard2()
                            }
                        }
                    }
                }
            }
        }
                .navigationBarHidden(true)
        .navigationBarBackButtonHidden(true)
        Spacer()
    }
}

}

This is my Home Screen Code HomeScreen Image

And this was the problem, if i use navigation in HomeScreen this default back arrow appears, when NavigationView is not in HomeScreen then it looks good in live preview, but i need to Navigate buttons in Home screen so i need to use NavigationView in Home screen. What else i can do to connect other Screens.

And i am a beginner, I need help to finish this project

Rogan R
  • 11
  • 2
  • Consider making your problem more concise and only focusing on the merit rather than providing the entirety of your project. You could, however, set up a GitHub repository and leave a link in the question; this will give future contributors a better grasp of the projects' main idea. – wictorious May 04 '21 at 11:20

0 Answers0