Skip to content

Instantly share code, notes, and snippets.

@andresr-dev
Created January 16, 2023 15:51
Show Gist options
  • Select an option

  • Save andresr-dev/10b1b27e34b1d354d7ff28e2a0c90a0c to your computer and use it in GitHub Desktop.

Select an option

Save andresr-dev/10b1b27e34b1d354d7ff28e2a0c90a0c to your computer and use it in GitHub Desktop.
This is how to stop a ScrollView from bouncing in SwiftUI
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