Skip to content

Instantly share code, notes, and snippets.

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 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