In my application I havea uiscrollview which contains a UIImageView. The UIImageView is a map, on this map the user presses on tab bar items and an icon is displayed on the map. I made it so that when the user taps a tab bar item them map will zoom to the icon location using the zoomToRect method, but when I implemented the setZoomScale the zoomToRect method stopped working.
The only time that zoomToRect works again is if I pinch or zoom in to my image. After doing that I press the tab bar item and then the scroll view zooms to that point on the map. It seems that it is only working if the zoomScale is different than the default zoomScale.
My default zoomScale is 1.0 and my setZoomScale is 1.0. Anytime they are different my pathToRect works fine. Anyone know whats going on?
offsetCoord = CGRectMake(frame.origin.x, frame.origin.y, self.rootScrollView.frame.size.width, self.rootScrollView.frame.size.height);
NSString *test = NSStringFromCGRect(offsetCoord);
NSLog(@"%@", test);
[coordIcon release];
}
[self.rootScrollView zoomToRect:offsetCoord animated:YES];
break; //break after displaying all icons on screen
[self.rootScrollView setZoomScale:1.0 animated:YES];
Any help is appreciatted :) thanks