Last active
March 18, 2021 01:04
-
-
Save alenm/93bb39741ae739d64e2ede4c3710bbff to your computer and use it in GitHub Desktop.
Equal Width Two Column SwiftUI
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
// 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