Say I have a Button in SwiftUI:
Button("Tap me") {
print("Button tapped!")
}
How can I can I make the font size of the Button's text larger and bold?
Use the bold() Text modifier on a Button's label.
Example:
Button {
print("Button tapped!")
} label: {
Text("Tap me").bold()
}
To make the text larger and bold, just chain the modifiers:
Button {
print("Button tapped!")
} label: {
Text("Tap me")
.font(.title)
.bold()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With