iOS - 资产维度

时间:2016-05-24 09:58:50

标签: ios uiimageview xcasset

我知道这种类型的问题已被多次询问,但我仍然无法理解是否有一种确定尺寸的标准方法。假设我在png中设计了一个屏幕。 enter image description here

现在,我如何确定要在图像视图中设置的任何静态样本图像的图像视图和尺寸(1x或2x或3x)的大小。

1 个答案:

答案 0 :(得分:0)

Normally when you are developing u get a folder which has all three 
resolutions of the same asset that you when drop in the xcassets, can 
see that 1x 2x and 3x automatically lie themselves in the respective shelf.

1x is for iphone <= 4s
2x normally is for iphone 5,5s,6,6s
3x normally is for 6 plus, ipad etc.

现在你要怎么弄清楚?为此:

Step 1 : Determine the screen size for which the design has been originally made, you'd be better off if u start with the smallest screen size (its comparatively simpler to scale small to big)

Step 2 : Open the design in mac **preview** app and select and drag any part. It'll show you the dimensions. Divide those by 2 and that's the size of the **uiimageview** you want. For example :

this shows the boundaries of my image so 93 by 34 is the size of my imageview to hold the asset perfectly

查看此链接是为了好 https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html