Created
June 19, 2020 15:14
-
-
Save gahntpo/0a5127dbbc69f0fc64d16c42104d3107 to your computer and use it in GitHub Desktop.
showing ZStack with default alignment behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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