0
votes

i created a navigation link and when i press the link edges no thing happen , i need to press the text only to sent me to next view


  NavigationLink(destination: RegisterView()) 
{Text("SIGN UP")}
.foregroundColor(Color(#colorLiteral(red: 0.2549019608, green: 0.2941176471, blue: 0.3529411765, alpha: 1)))
.padding()
.frame(width: 155, height: 50, alignment: .center)
.background(Color(#colorLiteral(red: 1, green: 0.7647058824, blue: 0.2274509804, alpha: 1)))
.cornerRadius(10)

enter image description here

1

1 Answers

1
votes

You have put modifiers on the wrong place. The solution would be ->

  NavigationLink(destination: RegisterView()) 
{Text("SIGN UP")
.foregroundColor(Color(#colorLiteral(red: 0.2549019608, green: 0.2941176471, blue: 0.3529411765, alpha: 1)))
.padding()
.frame(width: 155, height: 50, alignment: .center)
.background(Color(#colorLiteral(red: 1, green: 0.7647058824, blue: 0.2274509804, alpha: 1)))
.cornerRadius(10)}