简体   繁体   中英

How to resize image assets for all Apple devices? (not launch images)

My app displays 2 buttons on the top and a car picture (1 of 4 possible) at the bottom:

应用截图

Each image file has huge dimensions of 5616 x 3744 pixels and the app lags noticeably and also sometimes crashes (here fullscreen , Aspect Fill mode is used):

Xcode屏幕截图

So I would like to scale down the image assets and include these files (for each of the 4 car pictures) in my app:

  • car.jpg
  • car@2x.jpg
  • car@3x.jpg

After searching around and I think I have to target the Rendered Pixels sizes, that is:

  • 640 x 960 for iPhone 4
  • 640 x 1136 for iPhone 5
  • 750 x 1334 for iPhone 6
  • 1242 x 2208 for iPhone 6 Plus
  • and I have yet to look up the dimensions of iPads

However my image view has 20 pixels insets (here fullscreen ):

Xcode屏幕截图

So I am not sure, which value to subtract from the widths of car.jpg, car@2x.jpg and car@3x.jpg.

Should I subtract 40 pixels from each file (that is 20 on the left and 20 on the right)?

只需将图像调整为最大尺寸(@ 3x)-它会比现在小得多, aspect fill将处理其余部分

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM