Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How I change the weight from a text button?

i have a problem, i am trying to change the font weight from a button, but only bold works, if i change to medium or regular, don’t work. I using xcode 13.

the code

            Button("Login") {
            }.font(.title.bold())
            .font (.title3)
            .foregroundColor(.white)
            .padding(20)
            .frame(maxWidth: .infinity)
            .background(Color("ButtonColor"))
            .cornerRadius(4.0)
            

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Use it like

    Button("Login") {
    }
    .font(.title.weight(.heavy))   // << here !!

demo

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading