berkantbegdilili
berkantbegdilili

Reputation: 65

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

Upvotes: 0

Views: 80

Answers (2)

Asperi
Asperi

Reputation: 257789

Here is fix

 NavigationLink(destination: DrinksList()){
       VStack{
            Image("icecekler")
               .renderingMode(.original) // <<< this !!!

Upvotes: 1

Sorin Lica
Sorin Lica

Reputation: 7636

apply .buttonStyle(PlainButtonStyle()) on your NavigationLink

Upvotes: 1

Related Questions