iOS development-IPHONE6/6 plus adaptation

Source: Internet
Author: User

    • Before iOS6, screen fit general use AutoSize to set the dimension relationship of the view to the parent view
      • Defect: (Insufficient autosizing layout)
      • 1. Cannot set the relationship between views and views
      • 2. You cannot set the size to zoom in, the maximum value is reduced, the minimum value
    • After iOS6, use automatic layout. AutoLayout
    • IOS8 size classes (more abstract, square)
In addition, some of the major device parameters are as follows:

Point Scale
iPhone iPhone4 iPhone5 iPhone6 iphone6+
320*480 320*480 320*568 375*667 414*736
Pixel 320*480 640*960 640*1136 750*1334 1242*2208
pexel (equipment) ~ ~ ~ ~ 1920*1080
1 2 2 2 3
PPI 163 326 326 326 401

Other words. Now if you want to fit IPhone6 Plus. Then you need to provide an additional set of @3x pictures. (only a set of conventional, a set of @2x) can look at the value in scale.

Simply put: IPhone4, IPhone5, iPhone6 the PPI of these devices are the same, the default image priority is @2x. IPhone6 Plus has a higher pixel density and the default image takes precedence over @3x.

In addition, IPhone6 Plus is a bit different from other devices: the screen resolution obtained within the app is 1242*2208, but the actual resolution of the device is 1920*1080, when the system will zoom in on the overall display, downscale to 1/1.15. This feature has also appeared on OSX:

from the Xcode6 GM version, the simulator added IPhone6 and IPhone6 plus two, if the old project ran directly into the two simulator, the default is "Compatibility Mode", that is, the system will simply enlarge the content, the display effect is somewhat vague but acceptable. The device resolution and IPhone5 acquired within the app are the same: 320*568 point.

That is, your original project, which is not fitted with IPhone6 plus. But running on the IPhone6 Plus is no problem. The device resolution will be the same as 5. 320*568. That IPhone6 plus fits your app, not your app to fit IPhone6 Plus. This results in a high resolution of 6 that is useless.

So, we're going to manually turn on high-resolution mode.

enable high-resolution mode

There are 2 ways to enable high-resolution mode (currently I can find):

1. Add the launchimage of the large screen:
In Images.xcassets, delete the old Launchimage group, and then create a new Launchimage group to add the corresponding high-resolution picture. Here's a more detailed description: How to Add a Launch Image for the IPhone 6. If you want to quickly test the new effect, here are 3 sample images to download.

2. Add Launch screen File

Launch screen is a new feature of Xcode6 and IOS8, and it uses a xib file as a splash. This property is automatically ignored when the app is launched in the previous version of iOS and does not cause an exception.
First, click New File->ios User Interface->launch screen, and then enable it in the project setup:

The above two settings allow the app to enter high-resolution mode as long as any one is enabled, but if neither is set, the app will fall back to compatibility mode. Given that many apps now need to be compatible with IOS5, and the first method may have bugs on iOS5, the second approach is recommended.

So, to do well with these devices now, we need to learn AutoLayout (automatic layout), of course, this is only personal advice.

In addition, to prepare a copy of @3x pictures.

Again, to turn on high-resolution mode.

Again, careful observation of the 6+ simulator, its desktop can be displayed horizontally. Therefore, our application should also be adapted to the horizontal screen as far as possible on the 6+.


Unlimited Internet iPhone6 adaptation tutorial all video cloud disk download link
Download Link: Http://pan.baidu.com/s/1kTgK4AF Password: P7YP

iOS development-IPHONE6/6 plus 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.