.timer Text style expands it to fill the width, instead of taking space to fit the contained string. Is there a way to change this behavior?
Text(entry.timeFinished, style: .timer).multilineTextAlignment(.leading).opacity(0.5).background(Color.red)
Text("3:41").opacity(0.5).background(Color.blue)
Entire View:
struct TimePieceWidgetEntryView: View {
var entry: Provider.Entry
var body: some View {
VStack {
Text("Timer ⏱")
Text(Date().addingTimeInterval(600), style: .timer).opacity(0.5)
}.font(.title.bold().monospacedDigit())
.padding(5)
.widgetURL(entry.url)
}
}
body
code. By what you provided now, it works correctly if copied and pasted in the body as a standalone component. – GastroContentView
, you will see. – Gastrobody
of the view which is usingTimePieceWidgetEntryView
– Gastro