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,421
  • 4
  • 18
  • 34

2 Answers2

2

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

Code:

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

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

George
  • 19,234
  • 7
  • 57
  • 99
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
  • 243
  • 5