I'm unable to achieve anything like the font size used in the stock templates when trying to create a Circular Gauge in Swift UI. Here is my code for simply displaying three labels. The maximum value label ("101") clips. I can't set a minimumFontScaleFactor on the Text because it's not a proper view. Here is my current code:
If I just use a previous style complication like this I get the full size text fonts:
But I want to use the new SwiftUI complications so I can better customize for things like the rendering mode. Any suggestions?
Code Block struct GaugeSample: View { var body: some View { Gauge(value: currentHR, in: minHR...maxHR) { Image(systemName: "heart.fill") } currentValueLabel: { Text("66").complicationForeground() } minimumValueLabel: { Text("59") } maximumValueLabel: { Text("101") } .gaugeStyle(CircularGaugeStyle(tint: Gradient(colors: getGradientColors()))) }
If I just use a previous style complication like this I get the full size text fonts:
Code Block let template = CLKComplicationTemplateGraphicCircularOpenGaugeRangeText() template.centerTextProvider = CLKSimpleTextProvider(text: "99") template.leadingTextProvider = CLKSimpleTextProvider(text: "40") template.trailingTextProvider = CLKSimpleTextProvider(text: "120") template.gaugeProvider = CLKSimpleGaugeProvider(style: .ring, gaugeColors: [UIColor.blue,UIColor.red], gaugeColorLocations: [0.3,0.9], fillFraction: 0.4)
But I want to use the new SwiftUI complications so I can better customize for things like the rendering mode. Any suggestions?