Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Once you have resized the image down to 75x75 the quality is lost - resizing it back upwards won't restore it. So you have to keep a reference to the original unresized image to pass for uploading to the server. You could do this keeping two copies - your manually resized copy and the original copy for upload, and simply using the latter in your full sized view. </p> <p>But alternately, as robin has noted in the comment above, you can use the content mode of your UIImageView to have it automatically resize the image within the view based on the content mode.</p> <p>The relevant content modes for your situation are:</p> <p>UIViewContentModeScaleToFill, UIViewContentModeScaleAspectFill, UIViewContentModeScaleAspectFit</p> <p>These will all cause the image to be resized within the 75x75 UIImageView</p> <p>i.e.</p> <pre><code>myImageView.contentMode = UIViewContentModeScaleAspectFit; myImageView.image = myUnscaledImage; </code></pre> <p>The ScaleToFill will stretch your image so that it fills the available space - even if this distorts it.</p> <p>The ScaleAspectFill will stretch your image so that the shortest dimension (width or height) fills the available space, and will crop the longest dimension (width or height).</p> <p>The ScaleAspectFit will stretch your image so that the longest dimension still fits into the available space, and leave empty space around the shortest dimension (horizontal or vertical)</p> <p>UIViewContentModeScaleAspectFit is the one that seems most likely to fit your goal.</p> <p>One way to pop up a full screen image would be to cover your UIImageView with a transparent button, add an action handler for touch, and in that present a modal view controller which has an image view for your full image set to the view. Alternately subclass image view and add your own touch handling or use a gesture recognizer instead of a transparent button.</p> <p>If the full size image is larger than your view window and you want it to be scrollable then put it inside a scrollview. If you want it to be zoomable as well then load it into img tags inside a web view instead of using a scroll view.</p> <p>If you want the display to be temporary use an NSTimer and close the modal view controller when the time pops, or you could listen for the end of your upload http request and close the full size view when the image has finished uploading.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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