Last active
March 9, 2021 02:03
-
-
Save paulhimes/432f92c25cad2fbf84d789a0e0f6a438 to your computer and use it in GitHub Desktop.
OnLayout Tutorial 02
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 MainView: View { | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() | |
Text("ScrollView Content") | |
.multilineTextAlignment(.center) | |
.foregroundColor(.white) | |
.background(Color.blue.brightness(0.2)) | |
Spacer() | |
} | |
/// Add a constant padding of 123 points above | |
/// the stack. | |
.padding(.top, 123) | |
} | |
.background(Color.blue) | |
.overlay( | |
TitleBar(), | |
alignment: .top | |
) | |
.edgesIgnoringSafeArea(.all) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment