Code Block VStack { Text(Date().addingTimeInterval(600), style: .relative) }
When I preview this code in a traditional SwiftUI view, the code appears as expected; in the middle of the canvas (as there are no vertical or horizontal spacers).
Conversely, when I attempt to use the same code within a Widget, I find that the text is pushed all the way to the left side of the canvas, with no particular reason. Due to this, I have no way of centering the text. My only success in centering the text has been to embed in a HStack with multiple spacers;
Code Block HStack { Spacer() Spacer() Spacer() Spacer() Text(Date().addingTimeInterval(600), style: .relative) }
Is there any particular reason this would be the case? I've not found any documentation indicating that the manner in which WidgetKit views render Text would be any different than traditional SwiftUI views?