Skip to content

Instantly share code, notes, and snippets.

@gahntpo
Created June 19, 2020 15:30
Show Gist options
  • Save gahntpo/2ae8ba1071a706a03298b39cf06d4b2b to your computer and use it in GitHub Desktop.
Save gahntpo/2ae8ba1071a706a03298b39cf06d4b2b to your computer and use it in GitHub Desktop.
using absolute values to set the size of a view
Text("no frame - this is a long line that won't fit parent's size.")
.border(Color.green)
Text("with absolute frame - this is a long line that only has a width of 200 avaliable.")
.frame(width: 200, height: 100)
.border(Color.green)
Text("with fixedSize - this is a long line that won't fit parent's size.")
.fixedSize()
.border(Color.blue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment