Skip to content

Instantly share code, notes, and snippets.

@gahntpo
Created June 19, 2020 15:14
Show Gist options
  • Save gahntpo/0a5127dbbc69f0fc64d16c42104d3107 to your computer and use it in GitHub Desktop.
Save gahntpo/0a5127dbbc69f0fc64d16c42104d3107 to your computer and use it in GitHub Desktop.
showing ZStack with default alignment behavior
ZStack(alignment: .center) {
Text("first item")
.frame(width: 150, height: 100)
.background(Color.orange)
Text("second item")
.frame(width: 120, height: 70)
.background(Color.red)
Text("third item")
.frame(width: 80, height: 40)
.background(Color.gray)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment