Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Resize an Image within a Scrollview?
    text
    copied!<p>I have searched for a while now, and can't find anything that is specific to my problem.</p> <p>Basically, I have an image of a large map, I want users to be able to zoom in and out, and scroll through the map. I literally have all aspects of the zooming and scrolling working, although when I start up the app, the image (within the scroll view) is massive! The image is a large file (1200x1024) but it has to be so users can zoom right in without any pixelation.</p> <p>My question is, how can I make it so when I start the app, that image (map) fits to the size of the screen, and then from there, users can zoom in and scroll and etc? Because right now is looks like this when I start up: <a href="http://i.stack.imgur.com/kq1en.png" rel="nofollow">http://i.stack.imgur.com/kq1en.png</a></p> <p>Thank you heaps!</p> <p><strong>Current Code:</strong> (Under the 'FireViewController.m' file)</p> <pre><code>@synthesize scrollView, imageView; -(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{ returnimageView; } - (void)viewDidLoad { [super viewDidLoad]; UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Mezzanine Level"]]; self.imageView = tempImageView; scrollView.maximumZoomScale = 3.0; scrollView.minimumZoomScale = 0.3; scrollView.clipsToBounds = YES; scrollView.delegate = self; [scrollView addSubview:imageView]; [scrollView setContentSize:imageView.frame.size]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload