Skip to content

Instantly share code, notes, and snippets.

@gahntpo
Created June 19, 2020 14:53
Show Gist options
  • Save gahntpo/ebb27f50542365f48e4265837c9033a6 to your computer and use it in GitHub Desktop.
Save gahntpo/ebb27f50542365f48e4265837c9033a6 to your computer and use it in GitHub Desktop.
using VStack and HStack with different alignment
VStack(alignment: .leading, spacing: 10) {
Text("first item").background(Color.orange)
Text("second item").background(Color.red)
Text("third item").background(Color.gray)
}
HStack(alignment: .leading, spacing: 10) {
Text("first item")
.frame(height: 60)
.background(Color.orange)
Text("second item")
.frame(height: 40)
.background(Color.red)
Text("third item")
.frame(height: 30)
.background(Color.gray)
}
.border(Color.gray)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment