Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexanderBollbach/341e25fda2242fa4eb9671b80bc1bb15 to your computer and use it in GitHub Desktop.
Save AlexanderBollbach/341e25fda2242fa4eb9671b80bc1bb15 to your computer and use it in GitHub Desktop.
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