-
-
Save chriseidhof/0551660f9d0a362223f0a02ea41155f9 to your computer and use it in GitHub Desktop.
(me learning SwiftUI layout) https://twitter.com/steipete/status/1363151782428479490?s=21
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
//: A Cocoa based Playground to present user interface | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
HStack { | |
Text("Highlight :") | |
.background(Color.green) | |
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topTrailing) | |
.background(Color.yellow) | |
VStack(alignment: .leading) { | |
Text("Checkbox 111") | |
Text("Checkbox 2") | |
} | |
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) | |
.background(Color.red) | |
} | |
.frame(width: 400, height: 200) | |
} | |
} | |
struct ContentView_Preview: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment