Disable vertical scroll in scrollview when scrolling it horizontally - ios

I have a scroll view .I want to scroll it in both direction horizontal and vertical.But when i am scrolling the subview is bouncing as both scrolling are enabled. how to mange this issue like when i am scrolling the view vertically,horizontal scroll should be disabled.

Set the directionalLockEnabled property to YES.
However,
If the drag direction is diagonal, then scrolling will not be locked
and the user can drag in any direction until the drag completes.

Set scrollview.directionalLockEnabled to YES
Note: If this property is NO, scrolling is permitted in both
horizontal and vertical directions. If this property is YES and the
user begins dragging in one general direction (horizontally or
vertically), the scroll view disables scrolling in the other
direction. If the drag direction is diagonal, then scrolling will not
be locked and the user can drag in any direction until the drag
completes. The default value is NO

Related

Scrolling to CollectionView Cell that is off screen

I'm designing a UI with a horizontal collection view (see below) I can scroll left or right to see the cells but when I let go, it bounces back to the center. The behavior I want is that when you scroll to cells off screen, it stops on them (not bounces back). Unchecking Bouncing on Scroll in the attributes inspector has no impact, unchecking Bounce Horizontally doesn't let me scroll at all. How can I achieve the desired behavior?

IOS UIScrollView - scroll and click element at the same time

I have a UIScrollView with an button just outside the content area of the scrollView. The user has to scroll up and hold the spring effect which one finger and push the button with another finger. The problem is that the touch on the button is never detected.
Please see the illustration below
The scroll view in it's initial state. the orange area is the scrollView, the white area the button
The user is now scrolling and holding with one finger to overcome the spring effect of the UIScrollView, and want to click the button
Any suggestions?
Check this out:
UIScrollView blocks all touches while zooming or scrolling
Make sure you have multitouch set to YES on the scrollview and also don't have any subviews with exclusive touch enabled.

Vertical scroll causes swipe

I have a strange issue: When I scroll vertically it triggers swipe right/left events.
I've checked it on iOS...
The swipe events are bound to the data-role='page'.
you can try configuring the horizontalDistanceThreshold to a higher value to allow more horizontal movement when scrolling.

How do I prevent a scroll view from letting a user (temporarily) scroll a UIScrollView out of it's content area?

UIScroll view lets me declared a scrollable area when I have too much content for one page. Strangely, the scroll view in question behaves as desired in the X-axis, with no scrolling whatsoever allowed. Unfortunately, the Y axis -- where scrolling is necessary -- doesn't 'clip' the allowed scroll area to the content size. The user can scroll outside of the content size, and only after they let go does scroll view 'bounce' back to the allowed zone.
I want to prevent the user from scrolling further up than there is content to view (down doesn't bother me) because it looks 'wrong' to have the header at the top of the scroll view pull down, leaving the regular background behind it.
If you are making your UIScrollView in interface this is as simple as deselecting the
"Bounces, Bounces Horizontally, and Bounces Vertically"
check boxes in your scrollView's attributes. If you are designing the UIScrollView in code you can add this.
self.textView.alwaysBounceHorizontal = NO;
self.textView.alwaysBounceVertical = NO;
self.textView.bounces = NO;

horizontal scrolling of a scrollView in a scrollView - small problem

i have a scrollView that fits the whole screen. In that View i show some UIImages that scroll horizontally. Like in the PageControl Project from Apple.
Then, when the user taps the screen, i fade in a scrollView at the bottom with some other images. Also horizontally scrolling. Like in the ScrollView Project from Apple.
My problem is, that when i come to the end of the scrollView which was faded in, the upper scrollView also starts to drag. How can i stop that during activation of the second scrollView?
Redraw the frame limits on your first scrollView when the second enters the screen. That way, your touches won't respond to both views. This means you need a container-view to keep both views seperated from each other.
Then you just rescale it back whenever your second scrollView disappears.
Edit: or disable scroll in your first scrollview while the second is open.

Resources