Views within ZStack are rendered back-to-front, with the first view being placed at the back
use fixedSize()
to neglect the view size proposed to a view by its parent
HStack {
Button(action: {}) { Text("Cancel").fixedSize() }
.padding().frame(maxWidth: .infinity)
Divider()