0

I have a grid that is displaying different fields, and the email field, i want to display as white text, however even specifying white, it changes the color to a link the moment I set it to an email address.

VStack(alignment: .leading, spacing: 5) {
                        Text("Email")
                            .font(.custom("heavy", size: 18))
                            .foregroundColor(.white)
                        Text("Test1234@gmail.com")
                            .foregroundColor(.white)
                            .font(.custom("regular", size: 14))
                    }

enter image description here

How do I stop it from changing the foreground color or remove the fact its trying to define a link all together?

Bnd10706
  • 1,933
  • 5
  • 24
  • 39

2 Answers2

3

Use Text(verbatim:) to tell it to not format the text.

Code:

Text(verbatim: "Test1234@gmail.com")

Difference between Text("") and Text(verbatim: "")

George
  • 25,988
  • 10
  • 79
  • 133
0

Try this

VStack(alignment: .leading, spacing: 5) {
                        Text("Email")
                            .font(.custom("heavy", size: 18))
                            .foregroundColor(.white)
                        Text(verbatim: "Test1234@gmail.com")
                            .foregroundColor(.white)
                            .font(.custom("regular", size: 14))
                    }
bdeviOS
  • 449
  • 1
  • 6