I have a UIScrollView , and enabled scrolling . Its working fine with delegate methods.
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return MyScrollView;
}
But the problem i am facing is, i need to Zoom out the UIScrollView when I rotate the iPad.
What I have to code in this function
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
interfaceOrientation == UIInterfaceOrientationLandscapeRight){
}
if(interfaceOrientation == UIInterfaceOrientationPortrait ||
interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
}
}
You can use this method:
- (void)setZoomScale:(float)scale animated:(BOOL)animatedand set the scale to minimum zoom scale of your scrollview that you might have configured when you have created the scrollview.Example:
[MyScrollview setZoomScale:minimuzoomscale animated:YES];
Place above line in shouldAutorotate.