Basic ios-resolution adaptation

Source: Internet
Author: User

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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.