Basic ios-resolution adaptation
(1) Definition of resolution
Resolution refers to the number of pixels contained in a unit length. The unit is usually pixel/inch (ppi ). The resolution units are: (dpi points per inch), lpi (lines per inch), and ppi (pixels per inch ).
(2) ios resolution
There are currently three most important iOS devices (Apple TV and so on), divided into two categories by resolution
(1) iPhone/iPod Touch
General screen resolution: 320 pixels x 480 pixels
Normal Retina resolution: 640 pixels x 960 pixels
IPhone 5 screen resolution: 640 pixels x 1136 pixels
(2) iPad
General screen 768 pixels x 1024 pixels
Retina screen (iPad3, new iPad, iPad Air, retina screen iPad mini) 1536 pixels x 2048 pixels
This is also true in actual design and development. Apple uses Point in a unified manner to prevent confusion in thinking during communication (especially for programming implementation) describe the size of the interface elements, for example:
IPhone/iPod Touch
Page Description: x 320 (except for iPhone 5) x 480 (iPhone 5)
IPad
Page Description: x
Conversion Relationship
1 point = 1 pixel
Retina screen 1 point = 2 pixels
(3) ios Image Processing
When the ios system loads an image, it automatically selects the image based on whether the screen is a Retina screen. For example, the app automatically loads the @ 2x file suffix image on the Retina screen, and loads a normal image without the Retina screen.
(4) Obtaining device information
On the code writing interface, hard code is not allowed in some places and the location must be set flexibly.
Obtain the screen resolution [[UIScreen mainScreen] bounds]
You can use define in constant. h to conveniently call
# Define kScreenSize [UIScreen mainScreen]. bounds. size