简体   繁体   English

对不同iPhone上的iOS图像大小感到困惑

[英]Confused about ios image size on different iphone

I have a general question about how images are displayed on iphone For example iphone 5, 5s support 320x568 points or 640x1136 pixles. 我对如何在iphone上显示图像有一个一般性的疑问,例如iphone 5、5s支持320x568点或640x1136像素。 If I want to create 4 images all same size to take the whole screen when rendered in 5s portrait mode, can I say each image should be 160x284 pixels? 如果我想创建4张相同大小的图像,以5s纵向模式呈现整个屏幕,我可以说每张图像应该为160x284像素吗? Now what if the same app is now rendered in 4s or 6? 现在,如果同一应用程序现在以4s或6渲染怎么办? How the images are displayed? 图像如何显示? Those 4 160x284 images are still taking the whole screen? 那4张160x284的图像仍在全屏显示吗?

Thanks 谢谢

Yes the images can scale to take up the whole screen but will appear blurry. 是的,图像可以缩放以占据整个屏幕,但会显得模糊。 If you want the images to be crisp you will need to create 3 different versions for the 3 different pixel densities (iPhone 2-3, iPhone 4-5, iPhone 6). 如果要使图像清晰,则需要为3种不同的像素密度(iPhone 2-3,iPhone 4-5,iPhone 6)创建3个不同的版本。 The general convention is to name your assets like this: 一般约定是这样命名您的资产:

  • image.png image.png
  • image@2x.png image@2x.png
  • image@3x.png image@3x.png

Here's a handy guide I use that explains how things are rendered on the different models. 这是我使用的便捷指南,解释了如何在不同模型上渲染事物。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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