iPhone SwiftUI layouts
Explore interactive SwiftUI previews across every available iPhone screenshot variant.
201elements
Gauge
LinearGaugeStyle
A gauge style that displays a bar with a marker that appears at a point along the bar to indicate the gauge’s current value
SwiftUI code
@State private var currentValue = 0.42
var body: some View {
VStack {
Gauge(value: 0.42) {
Text("Foo")
}
Gauge(value: currentValue) {
Text("Foo")
} currentValueLabel: {
Text("\(currentValue)")
}
.padding(.vertical)
Gauge(value: currentValue) {
Text("Foo")
} currentValueLabel: {
Text("42")
} minimumValueLabel: {
Text("0")
} maximumValueLabel: {
Text("100")
}
}
.gaugeStyle(.linear)
}Compatibility
watchOS 7.0+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for LinearGaugeStyle.