Skip to content

Instantly share code, notes, and snippets.

@alenm
Last active March 18, 2021 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alenm/93bb39741ae739d64e2ede4c3710bbff to your computer and use it in GitHub Desktop.
Save alenm/93bb39741ae739d64e2ede4c3710bbff to your computer and use it in GitHub Desktop.
Equal Width Two Column SwiftUI
// Source: https://noahgilmore.com/blog/swiftui-two-columns-equal-width/
struct ContentView: View {
var body: some View {
HStack(alignment: .top, spacing: 0) {
Rectangle()
.fill(Color.blue)
.frame(minWidth: 0, maxWidth: .infinity)
Rectangle()
.fill(Color.red)
.frame(minWidth: 0, maxWidth: .infinity)
}.padding().background(Color.white)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment