Created
July 10, 2020 10:27
-
-
Save Gernot/51048d64f55c435764276cce2770fe22 to your computer and use it in GitHub Desktop.
Scrollable Centered Text
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
import SwiftUI | |
struct TestView: View { | |
var body: some View { | |
ScrollView { | |
VStack { | |
Text("Text Before") | |
ScrollView(.horizontal) { | |
Text("Scrollable Text") | |
.border(Color.red) | |
} | |
Text("Text After") | |
} | |
.frame(maxWidth: .infinity) | |
.border(Color.green) | |
} | |
.frame(width: 300) .border(Color.yellow) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment