Search code examples
swiftswiftuiswiftui-navigationlink

When I add NavigationLink in SwiftUI, it takes the content into the background


When I add NavigationLink in SwiftUI, it takes the content into the background. How can I solve this problem?

My code:

 NavigationLink(destination: DrinksList()){
       VStack{
            Image("icecekler")
                 .resizable()
                 .frame(width: 200, height: 200)
                 .cornerRadius(15)

             Text("İçecekler")
                 .font(.title)
                 .bold()

      }
}

Screenshot: enter image description here


Solution

  • apply .buttonStyle(PlainButtonStyle()) on your NavigationLink