Code for Toggle in SwiftUI is this:
Toggle(isOn: $vibrateOnRing) {
Text("Vibrate on Ring")
}
This will produce a toggle button with text label looking like this:
Vibrate on Ring | [--empty space--] | Toggle
I need a right-aligned text label, like this:
[--empty space--] | Vibrate on Ring | Toggle
How to do it in SwiftUI?
Here it is
Toggle(isOn: $vibrateOnRing) {
Text("Vibrate on Ring")
.frame(maxWidth: .infinity, alignment: .trailing)
}
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