choosing image assets to display

Discussion in 'iOS Programming' started by theprizerevealed, Oct 23, 2016.

  1. theprizerevealed macrumors member

    Feb 26, 2016
    I have a UIView that seems to be too small for the image that I'm trying to display. I have my images in groups with different resolutions with the greatest resolution at 3 times size.

    so if I have three files: file@3x.png, file@2x.png, and file@1x.png. How would I used Xcode to select a smaller image or any particular image to appear in my UIView? thanks for you help
  2. bjet767 macrumors 6502a

    Oct 2, 2010
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    If you use the image assets library in your project then you drop those images onto the 1x, 2x, 3x boxes for that image file. The device will choose the image to use based on the screen resolution. If you want to adjust the display size of the image you do that by adjusting the frame of the image view that displays the image. You would normally do that these days with constraints and possibly size classes.

Share This Page