UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

I dont want to use Form's for input data but I want to have the same style of NavigationLink(same look)

Forums > 100 Days of SwiftUI

Can someone help me how to do the NavigationLink to look the same as it would look like in the Form

2      

Use List instead, if you don't want Form.

2      

@ygeras I want to have a screen where part of the screen is meant for input data and the other part is a picture with some general data(ordinary Text) on the side. I want to make the entire screen scrollable so I tried to put the form under the ScrollView but then the form disapears. Now I try to get rid of the form but I want the NavigationLink look the same..

2      

Will it be close enough to look like nav link in form?

struct ContentView: View {
    var body: some View {
        NavigationStack {
            ZStack {
                Color(uiColor: .systemGroupedBackground)
                    .ignoresSafeArea()
                NavigationLink(destination: SecondView()) {
                    LabeledContent("Navigate") {
                        Image(systemName: "chevron.right")
                            .foregroundColor(Color(uiColor: .tertiaryLabel))
                            .imageScale(.small)
                            .fontWeight(.bold)

                    }
                    .padding(.vertical, 12)
                    .padding(.horizontal, 12)
                    .foregroundColor(.black)
                }
                .background(
                    RoundedRectangle(cornerRadius: 10)
                        .foregroundColor(.white)
                )
                .padding()
            }
        }
    }
}

struct SecondView: View {
    var body: some View {
        Text("Second View")
    }
}

2      

@This is really nice looking! Really good work. Thank you very much!

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.