I have some simple circular complications, that use a ZStack with SFSymbols.
On high contrast Watch Faces, I noted that the circle is slightly off to the top leading side.
I tried to set the ZStack alignment to center, fiddled around with Spacers, but I could not get it centered.
Is that a bug or am I missing something?
struct CircularWidgetDashed: View {
var entry: Provider.Entry
var body: some View {
ZStack {
Image(systemName: "circle.dashed")
.resizable()
.scaledToFit()
.foregroundColor(.green)
Text("\(entry.online)/\(entry.total)")
.foregroundStyle(.primary)
.font(.caption)
.fontWeight(.semibold)
}
.widgetAccentable()
}
}
Yeah, definitely wrong. I've just recreated this myself.
You should raise this as a bug at https://feedbackassistant.apple.com/ then post the FB number here.
I managed to get a normal dashed line to work, but the trade-off is that you have to get the right values for the circle size, or the dash where the line ends will be the wrong length when it hits the part where it started (if that makes sene?).
// Looks correct for Accessory Circular:
Circle()
.stroke(.green, style: StrokeStyle(lineWidth: 10, dash: [12.5, 7.25]))
// Looks correct for Accessory Corner:
Circle()
.stroke(.green, style: StrokeStyle(lineWidth: 7, dash: [11, 6.5]))
// Neither of those two looks right for Accessory Rectangular
You'll have to play around with the values for the different Accessory types if you decide to go with this option.