How can i zoom a UIView without using UIScrollBar? I can add pinch gesture recognizer but how can i move the zoomed image to selected area?
What prevents you from using UIScrollView? It is probably the most easy way to handle zooming and scrolling.
If UIScrollView is not allowed. You can probably add pinch and pan gesture recognizer and implement their delegates for zooming and scrolling.
Please check this..
Image-manipulation-with-uigesturerecognizer
Here is Sample Project
Related
I'm adding a view as a UIScrollview's subview. This subview determines the contentsize of scrollview. On this view I add a UIPinchGesture and in selector target method of gesture i resize the view and reset contentsize of scrollview. BTW I earlier tried zooming of scrollview but it didn't fulfilled my requirement so I did it with UIPinchGesture. My problem is that normally the content size of scrollview is greater than it's frame so scrolling is enabled. When I try to pinch with two fingers the scrollview's scrolling is triggered and Pinchgesture seldomly recognized. I can't disable scrolling of UIScrollview as this is one of my requirement. Can anybody help me to solve this problem.
Set delayContentTouches property of UIScrollView to NO (instead of the default YES). This will allow the touch to propagate to the subviews of the scroll view immediately.
Due to some requirements I'm zomming subview of UIScrollView with UIPinchGestureRecognizer and not using UIScrollView's default zooming. In selector of gesture I resize my subview with a factor and reset contentSize of UIScrollView. It's working perfectly. The problem is that when I resize the frame of subview then it's increased or decreased in one direction. I want it to zoomin/zoomout on touched point like in a UIScrollView or in Gallery of iOS. How can I achieve this?
Is it somehow possible to add a 3-finger swipe gesture on a system scale, like a hotkey ?
Yes, just like the notification center gesture, only from the other side. (sandboxed)
Maybe by using a Desktop-size overlay window that is transparent and captures swipe gestures ?
If you were to use a transparent, desktop-sized overlay window, CocoaNavigationGestures on Github may be of use for code on getting left and right swipes on both Leopard and Lion.
Create a gesture recognizer and use setNumberOfTouchesRequired = 3
How can I force a UIScrollView to ignore a pinch open gesture when already zoomed in fully?
The problem I have is that you can drag a scrollview while zooming, even if scrolling is currently disabled. I want to stop that from happening if already zoomed in fully, but still allow zoom out gestures.
Try _scrollView.bouncesZoom = NO;
I have a UIScrollView with zooming enabled. This zooming enabled scroll view is inside another UIScrollView. The outer scroll view should receive the two fingers pan/swipe to switch pages. Here is my problem, the UIScrollView can treat the two fingers pan/swipe as on finger, but if the inner scroll view enabled zooming, the pinch gesture recognizer in the inner scroll view will be very sensitive. Any tiny two fingers movement will be interpreted as a pinch gesture and it prevents the outer scroll view to receive two fingers pan. Is it possible to change the sensitivity of the pinch in UIScrollView.
I did see there is a #package variable called _scaleThreshold in UIPinchGestureRecognizer, but it is package variable and can't be accessed outside. It is impossible for me to change it.
I'm wondering whether there is a way to make the threshold larger for the pinch gesture in UIScrollView.
Thanks
You can set the scale and the velocity props of UIPinchGestureRecognizer, one of them maybe right for what you want.
EDIT: Or you could call the requireGestureRecognizerToFail:recognizerYouDontWantInterfering merhod on whatever gesture you want to take effect.