choosing image assets to display

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

  1. theprizerevealed macrumors member

    Joined:
    Feb 26, 2016
    #1
    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

    Joined:
    Oct 2, 2010
    #2
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    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