Skip to content

Instantly share code, notes, and snippets.

@gahntpo
Created June 19, 2020 15:43
Show Gist options
  • Save gahntpo/03adf8ad0e15c78ac370b921e8f62414 to your computer and use it in GitHub Desktop.
Save gahntpo/03adf8ad0e15c78ac370b921e8f62414 to your computer and use it in GitHub Desktop.
specifying the alignment position inside the frame
HStack {
Text("alignment: \n .leading")
.background(Color.orange)
.frame(width: 110, height: 100, alignment: .leading)
.border(Color.red)
Text("alignment: \n .center")
.background(Color.orange)
.frame(width: 110, height: 100, alignment: .center)
.border(Color.red)
Text("alignment: \n .trailing")
.background(Color.orange)
.frame(width: 110, height: 100, alignment: .trailing)
.border(Color.red)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment