I have a scroll view in which I have an image displaying a 960x960 image, but it scrolls to about 4x. I tried to record the width of all possible views, and everything claims to be 960x960 (or less, I think I registered the screen width once ...?)
I need this image to stop scrolling in the lower right corner of the image, and not enter the dead space. Any help would be greatly appreciated.
Damn, even telling me which object name is bigger than my scrollView.contentSize will put me on the right path ...
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Test-Image.png"]];
self.imageView = tempImageView;
[tempImageView release];
scrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
NSLog(@"What is my scrollView height attribute?...%f", scrollView.contentSize.height);
NSLog(@"What is in scrollView width attribute?...%f", scrollView.contentSize.width);
scrollView.contentOffset = CGPointMake(480, 480);
scrollView.maximumZoomScale = 8.0;
scrollView.minimumZoomScale = 0.25;
scrollView.clipsToBounds = YES;
scrollView.delegate = self;
[scrollView addSubview:imageView];
Derek source
share