Created
January 16, 2023 15:51
-
-
Save andresr-dev/10b1b27e34b1d354d7ff28e2a0c90a0c to your computer and use it in GitHub Desktop.
This is how to stop a ScrollView from bouncing in SwiftUI
This file contains hidden or 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 ScrollViewNoBounce: View { | |
| var body: some View { | |
| ScrollView { | |
| Text("Hello") | |
| } | |
| .onAppear { | |
| UIScrollView.appearance().bounces = false | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment