Having a Child-View inside Scroll- View and getting issues in Scroll on Top, Left, Right ?
Code for adding Pinch & Zoom in Child Sub-View
UIPinchGestureRecognizer *twoFingerPinch = [[[UIPinchGestureRecognizer alloc]
initWithTarget:self
action:@selector(twoFingerPinch:)]
autorelease];
[_childView addGestureRecognizer:twoFingerPinch];
Method For Pinch & Zoom a Child-View
- (void)twoFingerPinch:(UIPinchGestureRecognizer *)recognizer
{
//NSLog(@"Pinch scale: %f", recognizer.scale);
CGAffineTransform transform = CGAffineTransformMakeScale(recognizer.scale, recognizer.scale);
// you can implement any int/float value in context of what scale you want to zoom in or out
_childView.transform = transform;
_scrollView.contentSize =
CGSizeMake(_scrollView.frame.size.width,_childView.frame.size.height);
}
Is there any issues in Scroll-View ContentSize setting ?
Here is my Code
Thank you
Edit:
Set _scrollview frame size and _childview frame size same:
//Frame for scrollview 56, 92, 196, 408.
and implement this delegate
Also check your auto resizing flag in XIB. it is set to bottom margin.