iPhone屏幕尺寸、分辨率及适配

iPhone屏幕尺寸、分辨率及适配,第1张

根据勾股定理,可以得知iPhone4(s)的PPI计算公式为:
早期的iPhone3GS的屏幕分辨率是320 480(PPI=163),iOS绘制图形(CGPoint/CGSize/CGRect)均以point为单位(measured in points): 1 point = 1 pixel(Point Per Inch=Pixel Per Inch=PPI)
后来在iPhone4中,同样大小(35 inch)的屏幕采用了Retina显示技术,横、纵向方向像素密度都被放大到2倍,像素分辨率提高到(320x2)x(480x2)= 960x640(PPI=326), 显像分辨率提升至iPhone3GS的4倍(1个Point被渲染成1个2x2的像素矩阵)
但是对于开发者来说,iOS绘制图形的API依然沿袭point(pt,注意区分印刷行业的“磅”)为单位。在同样的逻辑坐标系下(320x480):
1 point = scale pixel(在iPhone4~6中,缩放因子scale=2;在iPhone6+中,缩放因子scale=3)。
可以理解为:scale=绝对长度比(point/pixel)= 单位长度内的数量比(pixel/point)

UIScreenh中定义了该属性:

//This value reflects the scale factor needed to convert from the default logical coordinate space into the device coordinate space of this screen //The default logical coordinate space is measured using points For standard-resolution displays, the scale factor is 10 and one point equals one pixel For Retina displays, the scale factor is 20 and one point is represented by four pixels
为了自动适应分辨率,系统会根据设备实际分辨率,自动给UIScreenscale赋值,该属性对开发者只读。

iOS8新增了nativeScale属性,初步看来nativeScale与scale没有太大区别:

@2x means 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 thedisplay in each dimension, horizontal and vertical
iPhone3GS时代,我们为一个应用提供图标(或按钮提供贴图),只需要iconpng。针对现在的iPhone4~6 Retina显示屏,需要制作额外的@2x高分辨率版本。
例如在iPhone3GS中,scale=1,用的图标是50x50pixel(logicalimagesize=50x50point);在iPhone4~6中,scale=2,则需要100×100pixel(logical imagesize=50x50point,乘以imagescale=dimensions in pixels),并且命名为icon@2xpng。
如果APP要同时兼容iPhone3GS~iPhone6,则需要提供iconpng/icon@2xpng两种分辨率的。

@3x means a new “triple” retina resolution, where eachuser interface point is represented by three display pixels A single @2x pointis a 2 × 2 square of 4 pixels; an @3x point is a 3 × 3 square of 9 pixels”
iPhone6+在实际渲染时,downsampling/115(1242x2208->1080x1920),准确的讲,应该是@246x。苹果为方便开发者用的是@3x的素材,然后再缩放到@246x上。
参考:[《为什么iPhone 6 Plus要将3x渲染的2208x1242分辨率缩小到1080p屏幕上?》]( >如果是苹果手机:
iphone5,5c和5s都是4英寸。其余的全部都是35英寸(包括iphone4,iphone4s等等)
如果是苹果平板电脑:ipad
mini和ipad
mini
2是79英寸,
其余所有ipad都是97英寸。

以iPhone 7手机为例,设置方法如下:

一、首先在iPhone 7手机桌面点击“设置”。

二、进入设置界面以后,选择“显示与亮度”选项。

三、然后找到“视图”一项并点击进入。

四、进入以后,选择”放大“就是放大后的图标。左右切换下面的可以查看放大后内容的效果,最后点击设定即可。

品牌型号:iPhone 12
系统:iOS154
iphone图标大小设置需要在设置显示与亮度界面中,点击视图设置即可。以iPhone 12手机为例,iphone图标大小设置的步骤为4步,具体 *** 作如下: 1 点击显示与亮度 <!-- 1第1步 点击显示与亮度 -->

在设置界面中,点击显示与亮度。

2 点击视图 <!-- 2第2步 点击视图 -->

在显示与亮度界面中,点击视图。

3 点击放大 <!-- 3第3步 点击放大 -->

在展开的界面中,点击放大。

4 点击设定 <!-- 4第4步 点击设定 -->

在展开的界面中,点击设定即可。

苹果手机图标大小调法需要调整设置,方法如下:

工具/原料:苹果12、IOS120

1、打开设置。

2、打开显示与亮度。

3、打开视图。

4、选择标准或者放大,然后点击设定,手机重启后即可生效。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/10534959.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-09
下一篇 2023-05-09

发表评论

登录后才能评论

评论列表(0条)

保存