Created
June 1, 2020 03:52
-
-
Save AlexanderBollbach/341e25fda2242fa4eb9671b80bc1bb15 to your computer and use it in GitHub Desktop.
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
struct ContentView: View { | |
let content = ["long word","b","an even longer sentence to display"] | |
var body: some View { | |
ScrollView(.horizontal) { | |
HStack { | |
ForEach(Array(content.enumerated()), id: \.offset) { e in | |
Text(e.element).frame(maxWidth: .infinity) | |
} | |
.background(Color.yellow) | |
} | |
.background(Color.orange) | |
} | |
.background(Color.blue) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment