I'd like to change my steppers foreground color, and I can't find the property that works on it. I'd prefer to keep the standard stepper with the colors changed, and not have to create a custom one.
accentColor and foregroundColor don't work.
Stepper(value: $timer, in: 1...30) {
Text("\(timer) " + "minutes")
.foregroundColor(.red)
}
.accentColor(.red)
.foregroundColor(.red)
}
This:

to this:

Is this even possible atm?
Set setDecrementImage, setIncrementImage images in view init..
struct ContentView: View {
init() {
UIStepper.appearance().setDecrementImage(UIImage(systemName: "minus"), for: .normal)
UIStepper.appearance().setIncrementImage(UIImage(systemName: "plus"), for: .normal)
}
var body: some View {
Stepper(value: $timer, in: 1...30) {
Text("\(timer) " + "minutes")
.foregroundColor(.red)
}
.accentColor(.red)
.foregroundColor(.red)
}
}
}
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