Created
June 19, 2020 15:37
-
-
Save gahntpo/dfbc971afa110e2f14b75d0767c828ef to your computer and use it in GitHub Desktop.
using flexible frames to layout depending on available space
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
HStack { | |
Text("using maxWidth 300") | |
.frame(minWidth: 100, idealWidth: 200, maxWidth: 300).border(Color.red) | |
Text("taking space") | |
} | |
HStack { | |
Text("using maxWidth 200") | |
.frame(minWidth: 100, idealWidth: 150, maxWidth: 200).border(Color.red) | |
Text("taking space") | |
} | |
HStack { | |
Text("using maxWidth 100") | |
.frame(minWidth: 10, idealWidth: 100, maxWidth: 100).border(Color.red) | |
Text("taking space") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment