how to prohibit UIScrollview scrolling when move in specific area? - iphone

I put one UIImageview as subview in a UIScrollview. When I zoom in the image, I can scroll the image around. Can I disable the scrolling when I touch and moving in a rectangle area of the image?
I want to get information from touchesBegan() of customed UIScrollview and customed UIImageview, but I found that when there are scrolling, no touchesBegan is called in customed UIImageview.

yourScrollView.scrollEnabled = YES; for scroll to be enabled.
yourScrollView.scrollEnabled = NO; for scroll to be disabled.

Related

iOS gesture recognition and processing

I have transparent UIImageView and UIScrollView under it , I want the UIImageView to recognize and process swipe gesture right and left , and pass the scroll up an down to the UIScrollView
How can I do it?
I added the swipe gestures to the image view and handle them, but I didn't find a way to pass the scrolling from the UIImage to UIScroll
You could could set the userInteractionEnabled property of the scroll view to NO and add several gesture recognizers to handle the different events (horizontal and vertical scrolling).

User Interaction Enable in a UIImageView under another UIImage View

I have two UIImageView in a UIView in my application. And I need to Zoom, Rotate and Move the UIImageView which is at bottom of the top one, I don't need to do any thing with top one. I've already implemented the code for Move, Rotate and Zoom but the problem is I cant enable the touch to UIImageview in bottom.
How to solve this problem?
UIImageView's have userInteractionEnabled set to NO by default. You have to explicitly set this to YES for the image view you want to allow touch events to occur on.

UIScrollView only detecting swipes at bottom

I have a UIScrollView with a zoomed image view contained within it. UIScrollView "contentSize" is about twice the height of the scrollview itself, enabling user to swipe the image up and down. What I'm seeing is that the "touch zone" for the UIScrollView (where it detects swiping, and scrolls the image accordingly) is only at the very bottom of the UIScrollView. Is there any property/method I can use to make the UIScrollView detect swipes throughout it's frame?
if you want touch points inside scrollview tgen you can use following delegate method-
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView

UIScrollView Zooming

Hi
I have taken a uiscrollview in xib IBOUTLET and have added a subview uitextview, and in that textview, have done horizontal scrolling since there are some contents to be displayed . i just need to do one thing that when user zoom in textview it should zoom , like when user touches two finger , it should have zooming gesture and zoom the content i have tried a lot however it didn't work. please let me know
Put a UITextView object into a UIScrollView object, and make the uitextview larger than the scrollView.
Also set property
scrollView.contentSize = textView.frame.size;
should be placed in the scrollViewDidEndZooming delegate

Detecting Taps on a subview in UIScrollView *and* ignoring pan gestures

I have displaying image thumbnails in a UIScrollView, if user taps on a thumbnail, the application should open that image. if, however, user drags on a thumb, the scroll view should pan. Right now the scrollview only scrolls if user is able to drag on the small empty space between the thumbnails. the subviews (the one's displaying image thumbs) use a UITapGestureRecognizer to detect taps, and exclusiveTouch on subviews is set to NO, UIScrollView has its canCancelContentTouches set to false.
Try leaving canCancelContentTouches set to YES, that allows the scroll view to override its subviews if it seems the user is trying to scroll.