1.iPhone Dimension Specification
Equipment IPhone |
Wide Width |
High Height |
Diagonal Diagonal |
logical Resolution (point) |
Scale Factor |
device Resolution (pixel) |
PPI |
3GS |
2.4 inches (62.1 mm) |
4.5 inches (115.5 mm) |
3.5-inch |
320x480 |
@1x |
320x480 |
163 |
4 (s) |
2.31 inches (58.6 mm) |
4.5 inches (115.2 mm) |
3.5-inch |
320x480 |
@2x |
640x960 |
326 |
5c |
2.33 inches (59.2 mm) |
4.90 inches (124.4 mm) |
4-inch |
320x568 |
@2x |
640x1136 |
326 |
5 (s) |
2.31 inches (58.6 mm) |
4.87 inches (123.8 mm) |
4-inch |
320x568 |
@2x |
640x1136 |
326 |
6 |
2.64 inches (67.0 mm) |
5.44 inches (138.1 mm) |
4.7-inch |
375x667 |
@2x |
750x1334 |
326 |
6+ |
3.06 inches (77.8 mm) |
6.22 inches (158.1 mm) |
5.5-inch |
414x736 |
@3x |
(1242x2208->) 1080x1920 |
401
|
2. Unit inch (inches)
1 inch = 2.54cm = 25.4mm 3. iphone width High
The width height (width/height) in the table above is the physical size of the phone, including the display and the border.
The following is a iphone4s of the broad height diagram:
4. Screen size
What we usually call the IPhone5 screen size is 4 inches, iPhone6 screen size is 4.7 inches, which refers to the length of the diagonal of the display screen (diagonal).
The following is the iphone5~6+ screen size specification:
5. Pixel Density PPI
PPI (Pixel/Inch by diagonal): Represents the number of pixels (Pixel) that are owned per inch along the diagonal.
The higher the PPI value, the higher the density of the display image, which is usually called the higher the resolution, the weaker the particle feeling.
According to the Pythagorean theorem, it can be learned that the PPI formula for IPhone4 (s) is:
The calculated results are slightly different because of the jagged effect of discrete sampling of pixels. 6. Scaling factor (scale factor between logic point and device pixel) (1) Origin of scale
The screen resolution of the early IPHONE3GS was 320*480 (ppi=163), and the iOS drawing graphics (cgpoint/cgsize/cgrect) were point-based (measured in points):
1 point = 1 pixel(Point/Inch=pixel per Inch=ppi)
Later in the iPhone4, the same size (3.5 inch) screen used the retina display technique, and the pixel density in both transverse and longitudinal directions was magnified to twice times, the pixel resolution increased to (320X2) x (480x2) = 960x640 (ppi=326), The image resolution is raised to 4 times times the IPHONE3GS (1 point is rendered as a 1 2x2 pixel matrix).
But for developers, the iOS graphics API still follows point (PT, which distinguishes the printing industry's "pounds") as a unit. In the same logical coordinate system (320X480):
1 point = Scale*pixel(in iphone4~6, the scaling factor is scale=2; in iphone6+, the scaling factor is scale=3).
Can be understood as:
scale= Absolute length ratio (point/pixel) = quantity ratio within the unit length (pixel/point)
(2) Uiscreen.scale
This property is defined in UIScreen.h :
The natural scale factor associated with the screen. (read-only)
@property (nonatomic,readonly) cgfloat scale Ns_available_ios (4_0);
--------------------------------------------------------------------------------
This value reflects the scale factor needed to convert from the default logical coordinate spaces into the dev Ice coordinate spaces of this screen.
The default logical coordinate is measured using points. For standard-resolution displays, the scale factor are 1.0 and one point equals one pixel. For Retina displays, the scale factor are 2.0 and one point are represented by four pixels.
--------------------------------------------------------------------------------
To automatically adapt to resolution, the system automatically assigns values to Uiscreen.scale based on the actual resolution of the device, which is read-only for developers. (3) Uiscreen.nativescale
iOS8 has new Nativescale properties:
Native scale factor of the physical screen
@property (nonatomic,readonly) cgfloat nativescale Ns_available_ios (8_0);
The following is the output under iphone6+, initially it seems that nativescale and scale are not much different:
--------------------------------------------------------------------------------
(LLDB) p (cgfloat) [[UIScreen mainscreen] scale]
(cgfloat) $ = 3
(LLDB) p (cgfloat) [[UIScreen Mainscreen] Nativescale]
(cgfloat) $ = 3
-------------------------------------------------------------------------------- (4) model identification
At the same logical resolution, it is possible to identify the IPHONE3GS or iPhone4 (s) by scale parameters. The following is a macro that defines whether the probe model is iphone6+, based on the Nativescale parameter:
--------------------------------------------------------------------------------
Not Uiuserinterfaceidiompad
#define Is_iphone (ui_user_interface_idiom () = Uiuserinterfaceidiomphone)
Detect IPhone6 Plus based on its native scale
#define is_iphone_6plus (Is_iphone && [[Uiscreenmainscreen] nativescale] = 3.0f)
--------------------------------------------------------------------------------
So, the same resolution and scale, how to distinguish between the model iPhone4 and 4s, IPhone5 and 5s. Through the