UIImageView Tap Gesture Sensitivity - ios5

I have an ImageView object on my screen. When I tap it, it displays an info in a bubble style view. The problem is the imageview is very thin and small, it does not pick the tap gesture. Any suggestions about how to increase the sensitivity? Any solutions?

You need to increase the size of the screen area that is responding to the tap. So you could make the imge view bigger (but set the content mode to center so the image isn't stretched).

Related

restrict my touch area to part of UIImageVIew

I have a UIViewController into which i added a UIImageView with CGRectMake(0,0,1024,704). (768-nav bar ht-status bar ht=704). I am working in landscape mode only. I added tap gesture to this UIImageView. But i want to restrict this tap area to the height to 604. This picture should make it a bit clear.
The area with red lines is the UIImageView and the are that has green and red lines is the area that does not need touch event.
Any idea how to go about doing this?
You can use the locationInView: method in UITabGestureRecognizer to know where the user tapped, and respond accordingly.

Possible to Limit Zooming / Panning Area in UIScrollView?

I have a UIViewController that implements a UIScrollView with the UIScrollViewDelegate. Attached to it is an UIImageView for which the user must crop the photo via zooming it and panning to fill the entire length of the screen. After the user has finished cropping and they hit done, the original UIImage gets sent to the next UIViewController.
I'm wondering, is there anyway, using the original image, to display it in a UIScrollView and allow the user to zoom and pan it so ONLY the cropped area gets shown? IE none of the image that was outside of the cropped area gets shown in zooming and panning? Is there a way to do this without explicitly cropping the image?
This might head you in the right direction: Displaying part of an image
Not to sure if this will work with the way you are displaying it. But if it does it could be a simple solution. You can also read through UIScrollviews and maybe use panGestureRecognizer and pinchGestureRecognizer to limit the area they can zoom and pan.
Set the content size of the UIScrollView to the rect of the cropped area.

Scrollview is bouncing back

I have a app where in once I tap on a textfield it slides on top of keyboard.
My scrollview is bouncing back when I scroll down my content. iPhone documentation says "by default, it “bounces” back when scrolling exceeds the bounds of the content."
Any clue how to get rid of this? Should I increase the content size of scrollview?
If you want to stop a UIScrollView from bouncing:
UIScrollView *myScrollView; ...
[myScrollView setBounces:NO];
If your question was about the scrolling behavior being different when the keyboard is on screen, double check that you have set the autoresize behavior of the Views appropriately.

How do you create an animation like the iBooks app's moving bookmark?

When you tap the bookmark, it slides down or up smoothly. As it slides up, it disappears as if behind the view directly above it. I know how to animate changing the frame of a view, but I don't know how to make it disappear like that. (I don't want to resize the UIImage, just slide the UIImageView up and out of sight.)
I figure I need an invisible button to toggle the animation, and an UIImageView to animate. Do I need to change the bounds of the UIImageView, or should I use the frame? I thought I could just change the height from X to 0, but it didn't seem to resize the UIImageView. I had a little luck with settings the bounds with clipping subview's enabled, but I wasn't quite there.
I don't think I understand the relationship between the bounds and the frame.
I ended up adding a parent UIView to contain the UIImageView. It has the dimensions in which I want the UIImageView to be viewable in, and then I just animate the frame so the Y dimension is equal to the negative height and it slides up nicely.
I was on the wrong track with the bounds.

iPhone - strange issue with UIScrollView and touches

I have two UIImageView objects inside my view (both 320x480 one above the other). The lower image view is inside a UIScrollView with scrolling and zooming enabled. Now I want to handle touches inside the other image view but it no longer detects any single taps.
I can understand that the UIScrollView handles all the touches which I do on it. But the touches on the image view above the scroll view are also not recognized.
Attached is an image with my view hierarchy. Can someone please tell me why the other image view's touches are also handled by the scrollview when it isn't a subview of scroll view?
And if the scrollview is bent on handling touches, how do I recognize touches on the other image view?
Thanks.
By default UIImageViews have userInteractionEnabled=NO;
Try setting it to YES (either in IB or in code).
I'm not sure, it might be that you need to set the frame size and/or content size of the scroll view properly. This page has a diagram of what I'm talking about.