Post

Replies

Boosts

Views

Activity

How do you set font weight for ButtonStyle in SwiftUI
Hi, I would like to ask how to change fontWeight of a button label within ButtonStyle. However I can't figure it how to do it. This is my code: struct CapsuleButtonStyle: ButtonStyle {     func makeBody(configuration: Self.Configuration) -> some View {         configuration.label             .font(.footnote)             .fontWeight(.bold) /* All modifiers work except this one*/             .foregroundColor(.white)             .padding(.horizontal, 11)             .padding(.vertical, 6)             .background(Color.blue)             .cornerRadius(.infinity)     } } Thanks for your help
7
0
7.1k
Apr ’23