@2xmeans the same “double”retina resolution that we’veseen on all iOS devices with retina displays to date, where each virtual pointin the user interface is represented by two physical pixels on thedisplayin each dimension, horizontal and vertical. iPhone3GS时代,我们为一个应用提供图标(或按钮...
(1)UIScreen.bounds// 返回整个屏幕在本地坐标系中的尺寸,起点为[0,0],单位为点 // 考虑横竖屏切换的影响,根据实际的屏幕方向(UIDeviceOrientation)获取屏幕的宽度和高度define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)define...
例如在iPhone3GS中,scale=1,用的图标是50x50pixel(logicalimage.size=50x50point);在iPhone4~6中,scale=2,则需要100×100pixel(logical image.size=50x50point,乘以image.scale=dimensions in pixels),并且命名为icon@2x.png。 如果APP要同时兼容iPhone3GS~iPhone6,则需要提供icon.png/icon@2x.png两种分辨率的图片。
例如在iPhone3GS中,scale=1,用的图标是50x50pixel(logicalimage.size=50x50point);在iPhone4~6中,scale=2,则需要100×100pixel(logical image.size=50x50point,乘以image.scale=dimensions in pixels),并且命名为icon@2x.png。 如果APP要同时兼容iPhone3GS~iPhone6,则需要提供icon.png/icon@2x.png两种分辨率的图片。
(2)UIScreen.nativeBounds 代码语言:txt 复制 **iOS8新增了nativeBounds属性,输出竖屏像素级分辨率:** 代码语言:javascript 复制 // The bounding rectangle of the physical screen,measured in pixels. (read-only) // This rectangle is based on the device in a portrait-up orientation. This value does...
ppi(pixels per inch)表示每英寸有多少个像素,是手机厂家宣传的重点之一,通常会直接给出数值。我们也可以通过屏幕像素,和对角线长度估算出来。 比如iPhone X,1125 × 2436 像素,5.8 英寸。屏幕是矩形,根据勾股定理,对角线就是√(1125 * 1125 + 2436 * 2436) = 2683像素,而对角线 5.8 英寸,于是ppi = 2683 ...
例如在iPhone3GS中,scale=1,用的图标是50x50pixel(logicalimage.size=50x50point);在iPhone4~6中,scale=2,则需要100×100pixel(logical image.size=50x50point,乘以image.scale=dimensions in pixels),并且命名为icon@2x.png。 如果APP要同时兼容iPhone3GS~iPhone6,则需要提供icon.png/icon@2x.png两种分辨率的图...
// Bounds of entire screen in points(本地坐标系,起点为[0,0]) @property(nonatomic,readonly) CGRect ***bounds***; //考虑转屏的影响,按照实际屏幕方向(UIDeviceOrientation)的宽高 #define ***SCREEN_WIDTH ***([UIScreenmainScreen].bounds.size.width) #define ***SCREEN_HEIGHT ***([UIScreen...
另外,人手指的最小点击范围是44pixels,所以在iPhone的很多细节上都是44pixels。 iPhone大小 - 单位inch(英寸)1inch=2.54cm=25.4mm 3. iPhone手机宽高 上表中的宽高(width/height)为手机的物理尺寸,包括显示屏和边框。 以下为iPhone4s的宽高示意图:
例如在iPhone3GS中,scale=1,用的图标是50x50pixel(logicalimage.size=50x50point);在iPhone4~6中,scale=2,则需要100×100pixel(logical image.size=50x50point,乘以image.scale=dimensions in pixels),并且命名为icon@2x.png。 如果APP要同时兼容iPhone3GS~iPhone6,则需要提供icon.png/icon@2x.png两种分辨率的图...