UIScrollView has a property scrollEnabled to disable all scrolling, but I want to disable only the vertical scrolling.
Is that possible? Thanks.
To hide the vertical scrollbar and prevent vertical scrolling, use overflow-y: hidden like so: HTML.
We will use SimultaneousGesture and DragGesture to disable scrolling. We will set DragGesture's minimum distance to 0, which will disable the drag gesture to stop the scroll behavior.
In android, ScrollView supports only vertical scrolling. In case, if we want to implement horizontal scrolling, then we need to use a HorizontalScrollView component.
If the scrollView's contentSize.height
is less than its bounds.size.height
it won't scroll vertically.
Try setting:
scrollView.contentSize = (CGSize){<yourContentWidth>, 1.0}
Swift
scrollView.contentSize = CGSize(width: <yourContentWidth>, height: 1.0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With