IPhone 6 Resolution and adaptation

Source: Internet
Author: User

Resolution and pixels

Verified by the new xcode6 simulator (the resolution is PT and the pixel is real pixel ):

1. iPhone 5 resolution 320x568, pixel 640x1136, @ 2x

2. iPhone 6 Resolution 375x667, pixel 750x1334, @ 2x

3. iPhone 6 plus resolution: 414x736, pixel: 1242x2208, @ 3x, (note: After rendering at this Resolution, the image aspect ratio is reduced by pixel resolution to 1080 p (1080x1920)


Method 1: determine the size of the current device in the Code and manually adjust the UI elements. The disadvantage is obvious: the code is complex, error-prone, difficult to maintain, and extremely flexible;

Method 2: Set the Visual Unit (uiview uibutton ...) the autoresizing attribute of. It specifies how to adjust the size and position of a view when its environment (parent view) changes, this method can be set in xcode interface Builder (storyboard or XIB), but it can only be adjusted for the parent-child relationship, such as whether the left margin is fixed or the size is variable, the adjustment of sibling relationships cannot be achieved, and the adjustment method of apps with relatively fixed UI is basically enough;

Adaptation method 3: Use autolayout and sizeclass to comprehensively adjust the parent-child relationship and sibling relationship of the UI Visual Unit, and the adjustment accuracy is higher: not only can we determine the basis for changing the position and size of a view, but we can also set different priorities for the basis, which conditions are met first and then what conditions are met, priority can be ensured for important positions and sizes, so that the entire app has strong dynamic tonality and can meet the needs of different devices and different application scenarios.

IPhone 6 Resolution and adaptation

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.